File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1897,7 +1897,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
18971897 kb .safeReq = AttribDict ()
18981898 kb .singleLogFlags = set ()
18991899 kb .reduceTests = None
1900- kb .tlsSNI = None
1900+ kb .tlsSNI = {}
19011901 kb .stickyDBMS = False
19021902 kb .stickyLevel = None
19031903 kb .storeCrawlingChoice = None
Original file line number Diff line number Diff line change @@ -45,12 +45,12 @@ def create_sock():
4545
4646 # Reference(s): https://docs.python.org/2/library/ssl.html#ssl.SSLContext
4747 # https://www.mnot.net/blog/2014/12/27/python_2_and_tls_sni
48- if kb .tlsSNI != False and hasattr (ssl , "SSLContext" ):
48+ if kb .tlsSNI . get ( self . host ) != False and hasattr (ssl , "SSLContext" ):
4949 for protocol in filter (lambda _ : _ >= ssl .PROTOCOL_TLSv1 , _protocols ):
5050 try :
5151 sock = create_sock ()
5252 context = ssl .SSLContext (protocol )
53- _ = context .wrap_socket (sock , do_handshake_on_connect = False , server_hostname = self .host )
53+ _ = context .wrap_socket (sock , do_handshake_on_connect = True , server_hostname = self .host )
5454 if _ :
5555 success = True
5656 self .sock = _
@@ -63,8 +63,8 @@ def create_sock():
6363 self ._tunnel_host = None
6464 logger .debug ("SSL connection error occurred ('%s')" % getSafeExString (ex ))
6565
66- if kb .tlsSNI is None :
67- kb .tlsSNI = success
66+ if kb .tlsSNI . get ( self . host ) is None :
67+ kb .tlsSNI [ self . host ] = success
6868
6969 if not success :
7070 for protocol in _protocols :
You can’t perform that action at this time.
0 commit comments