def enableSSL(self):
print("Enable SSL")
try:
sslversion = get_ssl_version(self.lsock)
self.lsock = ssl.wrap_socket(
self.lsock,
server_side=True,
keyfile=args.keyfile,
certfile=args.certfile,
ssl_version=sslversion,
)
try:
self.rsock = ssl.wrap_socket(self.rsock, ciphers="RC4-SHA")
except ssl.SSLError:
self.rsock = ssl.wrap_socket(self.rsock, ciphers=None)
except ConnectionResetError:
print("Connection lost")
except ssl.SSLEOFError:
print("SSL EOF Error during handshake")
except AttributeError:
# happens when there is no rsock, i.e. fake_server==True
pass
评论列表
文章目录