[pyOpenSSL] clien and server side jobs

Ogz comp.ogz at gmail.com
Sat Jul 2 15:49:26 CEST 2005


Below is a sample code part:

ctx = SSL.Context(SSL.SSLv23_METHOD)
ctx.load_verify_locations(cafile)
ctx.set_verify(SSL.VERIFY_PEER | SSL.VERIFY_FAIL_IF_NO_PEER_CERT, verify)

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

ssl = SSL.Connection(ctx, s)

ssl.connect((host, 443))

ssl.sendall("GET / HTTP/1.0\r\n\r\n")

at this point, the verify call back works. and if it turned 0 somehow
the execution stops. I want to understand the work logic of

SSL.VERIFY_FAIL_IF_NO_PEER_CERT, verify)

And will be happy if someone send me a sample code for both client and
server side, client side will have a public key and server side will
have both public and private and will be able to check whether this
user is allowed

Just two sample that shows the main logic.
I think it will be helpfull many other beginners like me.




More information about the pyopenssl-users mailing list