state of HTTPS serving from jython 2.7.x?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

state of HTTPS serving from jython 2.7.x?

Jeff Mitchell
Hello everyone!

First - I've never posted here before, so let me preface by saying that jython is an outstanding piece of work, so thanks to the dev team for their amazing work.

Every 6mo or year I do a quick check to see if a rudimentary HTTPS server works (that works in cpython), and have generally had issues (starting back around jython 2.4 and 2.5); that was okay, as it was well known that ssl was a missing module and it could be sort of worked around with leveraging the underlying java framework. (Doing a straight up HTTP Mixin server is a joy :)

With jython 2.7 release I did another quick check and still no dice (had the issue with the missing .accept() call); more recently I did a pull from mercurial and a build, and tried again -- this time (refreshed and built from source today just to be sure) the server runs but silently hangs. I didn't debug in further (sorry!); from the commit comments it sounds like we're building towards 2.7.1rc so it would sound like this stuff should (theoretically) work.

I'm wondering if it is a 'known thing' that HTTPS/ssl is just not reliable yet, or if it is something that is 'sometimes reliable' (for various use cases, specific codecs and browser combinations, etc and so on), or always reliable and I'm just being silly (quite possible! :)

Thanks again for the project, and your time in replying to my humble request!

Certificate is self-signed; something like:
openssl req -new -x509 -keyout server.key -out server.pem -days 365 -nodes

The code in question:


import BaseHTTPServer, SimpleHTTPServer
import ssl

print "build httpd"
httpd = BaseHTTPServer.HTTPServer ( ('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)

print "build and wrap socket"
httpd.socket = ssl.wrap_socket ( httpd.socket, certfile='./keystore/server.pem', server_side=True, keyfile='./keystore/server.key' )

print "serve forever"


Jython-users mailing list
[hidden email]