views:

63

answers:

2

For now I have the following lines in a project configuration on pylons:

[server:main]
...
ssl_pem = /path-to-pem/file-name.pem

so paster serves only HTTPS requests but not HTTP. Any HTTP request causes the following exception in paster debug console:

Traceback (most recent call last):
  File "/home/eigenein/Projects/Python/Pylons/lib/python2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 1068, in process_request_in_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
    self.handle()
  File "/home/eigenein/Projects/Python/Pylons/lib/python2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 442, in handle
    BaseHTTPRequestHandler.handle(self)
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "/home/eigenein/Projects/Python/Pylons/lib/python2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 431, in handle_one_request
    self.raw_requestline = self.rfile.readline()
  File "/usr/lib/python2.6/socket.py", line 406, in readline
    data = self._sock.recv(self._rbufsize)
Error: [('SSL routines', 'SSL23_GET_CLIENT_HELLO', 'http request')]

Is it possible to set up paster to serve HTTP requests too?

+1  A: 

According to Pylons FAQ, no.

http://wiki.pylonshq.com/pages/viewpage.action?pageId=13434886

It's quite old entry, but I can't find any changes that would allow configure it in future versions.

Maciej Kucharz
A: 

Generally, you should use some front-end server anyway, like nginx. Let it handle both SSL/Non-SSL, and then pass requests to paster over http/wsgi/fcgi.

Daniel Kluev