follow-up prev
This commit is contained in:
@@ -145,17 +145,16 @@ class TcpConnection(threading.Thread, util.PrintError):
|
|||||||
s = context.wrap_socket(s, do_handshake_on_connect=True)
|
s = context.wrap_socket(s, do_handshake_on_connect=True)
|
||||||
except ssl.SSLError as e:
|
except ssl.SSLError as e:
|
||||||
self.print_error(e)
|
self.print_error(e)
|
||||||
s = None
|
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
peer_cert = s.getpeercert()
|
peer_cert = s.getpeercert()
|
||||||
except OSError:
|
except OSError:
|
||||||
return
|
return
|
||||||
if s and self.check_host_name(peer_cert, self.host):
|
if self.check_host_name(peer_cert, self.host):
|
||||||
self.print_error("SSL certificate signed by CA")
|
self.print_error("SSL certificate signed by CA")
|
||||||
return s
|
return s
|
||||||
# get server certificate.
|
# get server certificate.
|
||||||
# Do not use ssl.get_server_certificate because it does not work with proxy
|
# Do not use ssl.get_server_certificate because it does not work with proxy
|
||||||
s = self.get_simple_socket()
|
s = self.get_simple_socket()
|
||||||
|
|||||||
Reference in New Issue
Block a user