|
|
@ -1,9 +1,17 @@
|
|
|
|
#!/usr/bin/python
|
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
################################
|
|
|
|
|
|
|
|
# Configuration starts here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
allowed_certs = '/home/sven/ssl/allowed'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Configuration ends here
|
|
|
|
|
|
|
|
################################
|
|
|
|
|
|
|
|
|
|
|
|
import socket, ssl, pprint
|
|
|
|
import socket, ssl, pprint
|
|
|
|
|
|
|
|
|
|
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
|
|
ssl_sock = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs='/home/sven/ssl/allowed')
|
|
|
|
ssl_sock = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs=allowed_certs)
|
|
|
|
ssl_sock.connect(('localhost', 9151))
|
|
|
|
ssl_sock.connect(('localhost', 9151))
|
|
|
|
|
|
|
|
|
|
|
|
ssl_sock.write('test data')
|
|
|
|
ssl_sock.write('test data')
|
|
|
|