File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1420,8 +1420,13 @@ def init_webapp(self):
14201420 else :
14211421 # SSL may be missing, so only import it if it's to be used
14221422 import ssl
1423- # Disable SSLv3 by default, since its use is discouraged.
1424- ssl_options .setdefault ('ssl_version' , ssl .PROTOCOL_TLSv1 )
1423+ # PROTOCOL_TLS selects the highest ssl/tls protocol version that both the client and
1424+ # server support. When PROTOCOL_TLS is not available use PROTOCOL_SSLv23.
1425+ # PROTOCOL_TLS is new in version 2.7.13, 3.5.3 and 3.6
1426+ ssl_options .setdefault (
1427+ 'ssl_version' ,
1428+ getattr (ssl , 'PROTOCOL_TLS' , ssl .PROTOCOL_SSLv23 )
1429+ )
14251430 if ssl_options .get ('ca_certs' , False ):
14261431 ssl_options .setdefault ('cert_reqs' , ssl .CERT_REQUIRED )
14271432
You can’t perform that action at this time.
0 commit comments