require certificates for TLS connections
This was being forced for the new Python 3.4-style TLS context wrapping, but not the old code. This change should make the behavior consistent regardless of Python version.master
parent
4cdda19636
commit
8654e7093f
2
irc.py
2
irc.py
|
@ -120,7 +120,7 @@ class Bot(asynchat.async_chat):
|
||||||
else:
|
else:
|
||||||
ca_certs = self.ca_certs
|
ca_certs = self.ca_certs
|
||||||
sock = ssl.wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLSv1,
|
sock = ssl.wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLSv1,
|
||||||
cert_reqs=ssl.CERT_OPTIONAL, ca_certs=ca_certs)
|
cert_reqs=ssl.CERT_REQUIRED, ca_certs=ca_certs)
|
||||||
# FIXME: this doesn't work with SSL enabled
|
# FIXME: this doesn't work with SSL enabled
|
||||||
#sock.setblocking(False)
|
#sock.setblocking(False)
|
||||||
self.set_socket(sock)
|
self.set_socket(sock)
|
||||||
|
|
Loading…
Reference in New Issue