Bug 836834 - Bring SNI support to Python
Bring SNI support to Python
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
20
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Matej Stuchlik
Fedora Extras Quality Assurance
http://bugs.python.org/issue5639
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-01 16:37 EDT by Tobias Mueller
Modified: 2016-02-10 09:43 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-26 04:36:45 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tobias Mueller 2012-07-01 16:37:51 EDT
Description of problem:
I am trying to use Python's urllib2.open with a SNI enabled host, i.e. vote.gnome.org. It does not work with Python 2.7 though :-(

The testcase is really simple:
$ cat /tmp/sni.py 
#!/usr/bin/env python

import urllib2

SNISITE = 'https://vote.gnome.org'
if __name__ == '__main__':
    data = urllib2.urlopen(SNISITE).read()
    print data

$ python /tmp/sni.py
Traceback (most recent call last):
  File "/tmp/sni.py", line 7, in <module>
    data = urllib2.urlopen(SNISITE).read()
  File "/usr/lib64/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 406, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
$

So Python 2.7 does not make use of SNI :-( Python 3.2 however, seems to have support. Maybe it's feasible to have that feature backported.
Comment 1 Fedora End Of Life 2013-01-16 08:22:12 EST
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 2 Tobias Mueller 2013-01-16 08:46:06 EST
Still an issue but the test site now is: https://sni.velox.ch/
Comment 3 Fedora Admin XMLRPC Client 2013-05-10 01:01:50 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 4 Fedora Admin XMLRPC Client 2013-05-10 01:02:23 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 5 Fedora Admin XMLRPC Client 2013-05-10 01:06:05 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 6 Fedora Admin XMLRPC Client 2013-05-10 01:13:49 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 7 Fedora Admin XMLRPC Client 2013-05-10 01:13:58 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 8 Fedora End Of Life 2013-07-03 16:06:16 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 9 Fedora End Of Life 2013-12-21 03:39:08 EST
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 10 Tobias Mueller 2014-01-07 08:37:42 EST
Still an issue. But with https://foo.sni.velox.ch/ as test site.
Comment 11 Bohuslav "Slavek" Kabrda 2014-06-04 07:49:35 EDT
Works for me on Fedora 20, python-2.7.5-11.fc20.x86_64. Is https://foo.sni.velox.ch/ still valid for testing this?
Comment 12 Fedora Admin XMLRPC Client 2015-05-12 08:02:18 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 13 Fedora End Of Life 2015-05-29 04:45:39 EDT
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 14 Fedora End Of Life 2015-06-29 07:39:34 EDT
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 15 Toshio Ernie Kuratomi 2015-07-13 11:54:55 EDT
Still happens but the test results are now different.

Here's a script to show the test failing on python2:

#!/usr/bin/python2
import urllib2
a = urllib2.urlopen('https://foo.sni.velox.ch/')
b = a.readlines()
print([l for l in b if 'server name indication extension' in l])


=> ['did not send a TLS server name indication extension\n']

And a script to test success on python3:

#!/usr/bin/python3
import urllib.request
a = urllib.request.urlopen('https://foo.sni.velox.ch/')
b = a.readlines()
print([l for l in b if b'server name indication extension' in l])

=> [b'sent the following TLS server name indication extension\n']


This might be something to ask ncoghlan whether it could be backported to an upstream version of python-2.7.x as well (similar to the update in 2.7.9 that brought TLS hostname verification).
Comment 16 Toshio Ernie Kuratomi 2015-07-13 12:31:38 EDT
Oops, tested that on Fedora 21 (python-2.7.8).  2.7.9 in Fedora 22 Does have the SNI functionality backported.

Fedora 21 is not EOL -- do we want to backport SNI?  I'm guessing that just like we didn't backport match_hostname() that we probably wouldn't backport SNI.  (although the case could also be made that backporting both would be a good thing).
Comment 17 Matej Stuchlik 2015-08-05 15:57:51 EDT
I'd prefer not to stray from upstream python more than necessary, so I'm -1 on backporting SNI. However, if someone absolutely needs it and cannot update to f22 leave a comment and we can work something out. :)
Comment 18 Jan Kurik 2015-12-22 06:29:15 EST
This bug is currently assigned to an unsupported release. If you think this bug is still valid and should remain open, please re-assign it to a supported release (F22, F23) or to rawhide.

Bugs which will be assigned to an unsupported release are going to be closed as EOL (End Of Life) on January 26th, 2016.

Note You need to log in before you can comment on or make changes to this bug.