Issue2720

classification
Title: wrap_scoket_exception: 'module' object has no attribute 'OP_NO_TLSv1_1'
Type: behaviour Severity: major
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: arao
Priority: Keywords:

Created on 2018-12-14.07:09:13 by arao, last changed 2018-12-16.08:41:27 by arao.

Messages
msg12205 (view) Author: arvind (arao) Date: 2018-12-14.07:09:12
I am creating thread based https server with few disabled protocols(I am disabling TLSv1.1) in ssl context.

There are two issues which i am facing . 
When using jython-standalone-2.7.1.jar, TLS handshake just hangs forever. 

I used same code with jython-standalone-2.7.1b3.jar which gives different error. 
wrap_scoket_exception: 'module' object has no attribute 'OP_NO_TLSv1_1'

Below is sample code 

class ThreadedHTTPServer(ThreadingMixIn, BaseHTTPServer.HTTPServer):
    def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True):
        BaseHTTPServer.HTTPServer.__init__(self, server_address, RequestHandlerClass, bind_and_activate)
    def wrap_thread_socket(self, cert):
		context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
		context.options |= ssl.OP_NO_TLSv1_1
		context.load_cert_chain(cert)
		self.socket = context.wrap_socket(self.socket,  server_side=False)

httpd = ThreadedHTTPServer(("", getTLSPort()), Handler)
httpd.wrap_thread_socket(tlsCertificate)


This totally works with python version 2.7 and code runs smooth.
Please help.
History
Date User Action Args
2018-12-16 08:41:27araosetmilestone: Jython 2.7.1 ->
2018-12-14 07:09:13araocreate