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
mutantmonkey 2014-06-02 15:26:15 -07:00
parent 4cdda19636
commit 8654e7093f
1 changed files with 1 additions and 1 deletions

2
irc.py
View File

@ -120,7 +120,7 @@ class Bot(asynchat.async_chat):
else:
ca_certs = self.ca_certs
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
#sock.setblocking(False)
self.set_socket(sock)