class PlomSocketSSL(PlomSocket):
- def __init__(self, *args, server_side=False, certfile=None, keyfile=None, **kwargs):
+ def __init__(self, *args, certfile, keyfile, **kwargs):
import ssl
super().__init__(*args, **kwargs)
- if server_side:
- self.socket = ssl.wrap_socket(self.socket, server_side=True,
- certfile=certfile, keyfile=keyfile)
- else:
- self.socket = ssl.wrap_socket(self.socket)
+ self.send('NEED_SSL')
+ self.socket = ssl.wrap_socket(self.socket, server_side=True,
+ certfile=certfile, keyfile=keyfile)
import threading
if self.server.socket_class == PlomSocketSSL:
plom_socket = self.server.socket_class(self.request,
- server_side=True,
certfile=self.server.certfile,
keyfile=self.server.keyfile)
else:
class PlomTCPServerSSL(PlomTCPServer):
- def __init__(self, *args, certfile=None, keyfile=None, **kwargs):
+ def __init__(self, *args, certfile, keyfile, **kwargs):
super().__init__(*args, host='0.0.0.0', **kwargs)
self.certfile = certfile
self.keyfile = keyfile