Require valid certificate

develop
Sven Slootweg 13 years ago
parent 6cf311597c
commit 8bc4b64842

@ -4,7 +4,7 @@ import socket, ssl, pprint
while True:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ssl_sock = ssl.wrap_socket(s, cert_reqs=ssl.CERT_NONE)
ssl_sock = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs='/home/sven/ssl/allowed')
ssl_sock.connect(('localhost', 9151))
ssl_sock.write('test data')

Loading…
Cancel
Save