~mcepl/m2crypto#203: 
HTTPConnection lefts behind opened SSL.Connection

Migrated from: https://gitlab.com/m2crypto/m2crypto/-/issues/203
Created by: Matěj Cepl mcepl@cepl.eu
Created at: 2018-02-26T12:35:32.930Z

See https://bugzilla.suse.com/show_bug.cgi?id=1068470, and https://github.com/openSUSE/osc/issues/384#issuecomment-367849209

  1. The copied code in osc.myHTTPSHandler.https_open does the following:
fp = socket._fileobject(r)

Calling fp.close() (which is indirectly called through the addinfourl object) is a NOP (except a flush()). We should use

fp = socket._fileobject(r, close=True)

(I just checked the recent M2Crypto code and that's what it also does).

However, that's not sufficient, because a ``fp.close()`` still won't close the connection, because ``h.fp`` (``h`` is a ``httplib.HTTPResponse`` instance) is again wrapped in a ``socket._fileobject`` that was created with ``close=False`` (see ``httplib.HTTPResponse.__init__`` and ``M2Crypto.SSL.Connection.makefile``)
  1. In the same vein, M2Crypto.m2urllib.HTTPSHandler.https_open is affected: the SSL.Connection is not properly closed, because calling close() on the addinfourl instance, which is returned by https_open, is a "NOP".
Status
REPORTED
Submitter
~mcepl
Assigned to
No-one
Submitted
7 months ago
Updated
7 months ago
Labels
No labels applied.

~mcepl referenced this from #202 7 months ago

~mcepl 7 months ago

Changed on 2018-02-26T12:39:54.766Z by Matěj Cepl:

mentioned in merge request !185

~mcepl 7 months ago

Changed on 2018-02-28T09:08:20.381Z by Matěj Cepl:

mentioned in issue #202

~mcepl 7 months ago

Changed on 2018-04-24T08:42:29.210Z by Matěj Cepl:

changed milestone to 0.31

~mcepl 7 months ago

Changed on 2018-10-02T11:53:22.575Z by Matěj Cepl:

changed milestone to 0.32

~mcepl 7 months ago

Changed on 2018-11-11T23:33:56.131Z by Matěj Cepl:

mentioned in merge request !219

~mcepl 7 months ago

Changed on 2019-03-05T07:59:28.989Z by Matěj Cepl:

changed milestone to 0.33

~mcepl 7 months ago

Changed on 2019-04-26T14:30:19.332Z by Matěj Cepl:

changed milestone to 0.34

~mcepl 7 months ago

Changed on 2019-05-30T19:58:23.979Z by Matěj Cepl:

changed milestone to 0.35

(Last edited at 2019-05-30T19:58:23.982Z.)

~mcepl 7 months ago

Changed on 2019-06-08T06:32:44.308Z by Matěj Cepl:

changed milestone to 0.36

(Last edited at 2019-06-08T06:32:44.312Z.)

Register here or Log in to comment, or comment via email.