]> granicus.if.org Git - python/commitdiff
Issue #20896, #22935: The ssl.get_server_certificate() function now uses the
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 6 Jan 2015 11:21:26 +0000 (12:21 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 6 Jan 2015 11:21:26 +0000 (12:21 +0100)
ssl.PROTOCOL_SSLv23 protocol by default, not ssl.PROTOCOL_SSLv3, for maximum
compatibility and support platforms where ssl.PROTOCOL_SSLv3 support is
disabled.

Lib/ssl.py
Misc/NEWS

index 392603c56de8cf4582f784c31bb41173d80da696..3b667ff01ae93bd9eac09cd79584f1ccebca22bf 100644 (file)
@@ -922,7 +922,7 @@ def PEM_cert_to_DER_cert(pem_cert_string):
     d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
     return base64.decodebytes(d.encode('ASCII', 'strict'))
 
-def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
     """Retrieve the certificate from the server at the specified address,
     and return it as a PEM-encoded string.
     If 'ca_certs' is specified, validate the server cert against it.
index 72d0d5fb0e9f905aeb11bbf7f4a573c3dc9c41ac..79cb8ee75bc2697a83a4beb0a50d78dd5d2b6249 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -44,6 +44,11 @@ Core and Builtins
 Library
 -------
 
+- Issue #20896, #22935: The :func:`ssl.get_server_certificate` function now
+  uses the :data:`~ssl.PROTOCOL_SSLv23` protocol by default, not
+  :data:`~ssl.PROTOCOL_SSLv3`, for maximum compatibility and support platforms
+  where :data:`~ssl.PROTOCOL_SSLv3` support is disabled.
+
 - Issue #23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol
   version.