Using pagekit on Synology (DS107) gives me some problems..
Server response parsing failed: Neither pyOpenSSL nor python 2.6+ ssl modules found
Python 2.5.5 (r255:77872, May 14 2010, 02:24:16)
is it possible to change the python code to use the build in ssl ?
http://martin.piware.de/
Creating an HTTPS server in Python
JAN4
Gepostet von pitti in ubuntu | 1 Kommentar
For a test suite I need to create a local SSL-enabled HTTPS server in my Python project. I googled around and found various recipes using pyOpenSSL, but all of those are quite complicated, and I didn’t even get the referenced one to work.
Also, Python has shipped its own built-in SSL module for quite a while. After reading some docs and playing around, I eventually got it to work with a remarkably simple piece of code using the builtin ssl module:
import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='path/to/localhost.pem', server_side=True)
httpd.serve_forever()
(I use port 4443 so that I can run the tests as normal user; the usual port 443 requires root privileges).
Way to go, Python!
Pagekite.py will use the native Python SSL modules if they are present. If they aren't, there's not much we can do - but even without SSL support, pagekite.py should be able to connect to a front-end, so I am not sure exactly what is causing problems for you.
I recommend you join us on the chat so we can go over your problems live.
Comments
Server response parsing failed: Neither pyOpenSSL nor python 2.6+ ssl modules found
Python 2.5.5 (r255:77872, May 14 2010, 02:24:16)
is it possible to change the python code to use the build in ssl ?
http://martin.piware.de/
Creating an HTTPS server in Python
JAN4
Gepostet von pitti in ubuntu | 1 Kommentar
For a test suite I need to create a local SSL-enabled HTTPS server in my Python project. I googled around and found various recipes using pyOpenSSL, but all of those are quite complicated, and I didn’t even get the referenced one to work.
Also, Python has shipped its own built-in SSL module for quite a while. After reading some docs and playing around, I eventually got it to work with a remarkably simple piece of code using the builtin ssl module:
import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='path/to/localhost.pem', server_side=True)
httpd.serve_forever()
(I use port 4443 so that I can run the tests as normal user; the usual port 443 requires root privileges).
Way to go, Python!
Pagekite.py will use the native Python SSL modules if they are present. If they aren't, there's not much we can do - but even without SSL support, pagekite.py should be able to connect to a front-end, so I am not sure exactly what is causing problems for you.
I recommend you join us on the chat so we can go over your problems live.
I had to install:
py25-openssl
(ipkg install <package>
grz
~remke
? which chat / irc server/channel