This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author desbma
Recipients desbma
Date 2014-11-27.19:42:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
http.client.HTTPSConnection has both a check_hostname parameter, and a context parameter to pass an already setup SSL context.
When check_hostname is not set and thus is None, and when passing a SSL context set to NOT check hostnames, ie:

import http.client
import ssl

ssl_context = ssl.create_default_context() 
ssl_context.check_hostname = False
https = http.client.HTTPSConnection(..., context=ssl_context)

The https object WILL check hostname.

In my opinion the line :
            will_verify = context.verify_mode != ssl.CERT_NONE

Should be changed to:
            will_verify = (context.verify_mode != ssl.CERT_NONE) and (context.check_hostname)
Date User Action Args
2014-11-27 19:42:39desbmasetrecipients: + desbma
2014-11-27 19:42:39desbmasetmessageid: <>
2014-11-27 19:42:39desbmalinkissue22959 messages
2014-11-27 19:42:39desbmacreate