[issue11811] ssl.get_server_certificate() does not work for IPv6 addresses

Charles-Francois Natali report at bugs.python.org
Wed Apr 27 23:02:30 CEST 2011


Charles-Francois Natali <neologix at free.fr> added the comment:

A patch is attached, along with corresponding test.
Notes:
- since I don't have an IPv6 internet connectivity, I could only test it locally
- I chose 'ipv6.google.com' as SSL server for the test. If it's a problem, I can change it for svn.python.org (it'll just take a couple more lines to make sure that we're using IPv6 and not IPv4)
- while writting the test, I needed a way to find whether IPv6 is supported on the current host (socket.has_ipv6 only tells you that the interpreter has been built with IPv6 support, not that the OS has an IPv6 stack enabled). So instead of rewritting what's already done in test_socket, I added a new is_ipv6_enabled function in Lib/test/support.py, and modified test_socket, test_ftplib and test_ssl to use it. This patch (is_ipv6_enabled.diff) must be applied before ssl_ipv6.diff.

----------
keywords: +patch
nosy: +neologix
Added file: http://bugs.python.org/file21811/ssl_ipv6.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11811>
_______________________________________


More information about the Python-bugs-list mailing list