Client getting pyOpenSSL to resume SSL session

I try to prevent my pyOpenSSL client from resuming a TLS / SSL session if several connections (sending HTTP requests) to Tomcat application server are successful. I am sure that everything works fine on the server, as I have several other clients making similar connections, and all of them can do a session resume.

For the first connection, I create an ssl context. Then I just reuse the context for subsequent connections

# Just do this for the first and then reuse the context for subsequent connections.
ssl_context = SSL.Context(SSL.SSLv23_METHOD)
ssl_context.set_options(SSL.OP_NO_SSLv2)


# Do this for every connection
sock = socket.create_connection((self.host, self.port), self.timeout)
sslconn = SSL.Connection(ssl_context, sock)
sslconn.set_connect_state()
sslconn.do_handshake()
+3
source share

Source: https://habr.com/ru/post/1786533/


All Articles