mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
follow-up prev
This commit is contained in:
parent
5220451b73
commit
5f050aa13e
1 changed files with 8 additions and 9 deletions
|
@ -145,17 +145,16 @@ class TcpConnection(threading.Thread, util.PrintError):
|
|||
s = context.wrap_socket(s, do_handshake_on_connect=True)
|
||||
except ssl.SSLError as e:
|
||||
self.print_error(e)
|
||||
s = None
|
||||
except:
|
||||
return
|
||||
|
||||
try:
|
||||
peer_cert = s.getpeercert()
|
||||
except OSError:
|
||||
return
|
||||
if s and self.check_host_name(peer_cert, self.host):
|
||||
self.print_error("SSL certificate signed by CA")
|
||||
return s
|
||||
else:
|
||||
try:
|
||||
peer_cert = s.getpeercert()
|
||||
except OSError:
|
||||
return
|
||||
if self.check_host_name(peer_cert, self.host):
|
||||
self.print_error("SSL certificate signed by CA")
|
||||
return s
|
||||
# get server certificate.
|
||||
# Do not use ssl.get_server_certificate because it does not work with proxy
|
||||
s = self.get_simple_socket()
|
||||
|
|
Loading…
Add table
Reference in a new issue