SSL failure in wsgiserver

20 views
Skip to first unread message

Dusty Phillips

unread,
Jan 29, 2009, 10:00:32 AM1/29/09
to web.py
I'm getting incorrect behaviour when accessing an HTTPS request via
HTTP with the cherrypy wsgiserver. I've configured it to use SSL like
so:

CherryPyWSGIServer.ssl_certificate=os.path.join(app_dir,
"mycert.crt")
CherryPyWSGIServer.ssl_private_key=os.path.join(app_dir,
"mycert.key")

If I access my web.py resource using https:// everything works fine.
However, if I use http:// I expect it to gracefully return a 400 Bad
Request response. Instead, I get the following traceback, and the
browser receives no data:

Exception in thread CP WSGIServer Thread-1:
Traceback (most recent call last):
File "...python/lib/python2.6/threading.py", line 522, in
__bootstrap_inner
self.run()
File "...python/lib/python2.6/site-packages/web.py-0.31-py2.6.egg/
web/wsgiserver/__init__.py", line 1261, in run
conn.communicate()
File "...python/lib/python2.6/site-packages/web.py-0.31-py2.6.egg/
web/wsgiserver/__init__.py", line 1199, in communicate
"The client sent a plain HTTP request, but "
File "...python/lib/python2.6/site-packages/web.py-0.31-py2.6.egg/
web/wsgiserver/__init__.py", line 595, in simple_response
self.wfile.sendall("".join(buf))
File "...python/lib/python2.6/site-packages/web.py-0.31-py2.6.egg/
web/wsgiserver/__init__.py", line 730, in sendall
bytes_sent = self.send(data)
File "...python/lib/python2.6/site-packages/web.py-0.31-py2.6.egg/
web/wsgiserver/__init__.py", line 737, in send
return self._sock.send(data)
Error: [('SSL routines', 'SSL23_GET_CLIENT_HELLO', 'http request')]

I followed the trace and communicate() appears to be trying to send
the 400 bad request, but when it gets sent out in _sock.send, it is
still trying to talk SSL. Is this a bug in the wsgiserver, or is it
something on my side?

I'm using web.py 0.31 and python2.6 under MacOS 10.5. I'm pretty sure
this was working correctly under web.py 0.23, but I don't know when
this problem started to manifest itself or if it was caused by
upgrading to 0.3[1] or some change I've made internally. Does anyone
have any ideas?

Thanks
Dusty

leone

unread,
Jan 29, 2009, 10:38:11 AM1/29/09
to web.py
Same behaviour using Ubuntu 8.10, webpy 0.31, python 2.6.
I ask for the problem to cherrypy group, but they explained only the
error meaning.


Dusty Phillips ha scritto:

Dusty Phillips

unread,
Jan 29, 2009, 11:06:04 AM1/29/09
to web.py

On Jan 29, 10:38 am, leone <handja...@gmail.com> wrote:
> Same behaviour using Ubuntu 8.10, webpy 0.31, python 2.6.
> I ask for the problem to cherrypy group, but they explained only the
> error meaning.

Hi leone,

I found the related thread:

http://groups.google.com/group/cherrypy-users/browse_thread/thread/e776eccf35fed343

I'll follow up there to see if there is any more information.

Dusty

Dusty Phillips

unread,
Jan 31, 2009, 10:07:39 AM1/31/09
to web.py
Hey all,

This looks to be a bug in the cherrypy wsgi server used by web.py. I
want to file a bug report with cherrypy, but first, I was wondering if
the web.py devs could provide some additional information:

1. Is the cherrypy wsgi server included with web.py modified at all?
2. What version of cherrypy is it?
3. What version of cherrypy was used in web.py 0.23, which I think
worked ok?
4. Any reason you can think of that this bug may actually be web.py
specific? I'm not currently in a position to test a standard cherrypy
install.

I'll include this info in a cherrypy bug report and hopefully we can
see this issue fixed in the next release of web.py. :-)

Thanks,
Dusty

On Jan 29, 11:06 am, Dusty Phillips <buch...@gmail.com> wrote:
> On Jan 29, 10:38 am, leone <handja...@gmail.com> wrote:
>
> > Same behaviour using Ubuntu 8.10, webpy 0.31, python 2.6.
> > I ask for the problem to cherrypy group, but they explained only the
> > error meaning.
>
> Hi leone,
>
> I found the related thread:
>
> http://groups.google.com/group/cherrypy-users/browse_thread/thread/e7...
Reply all
Reply to author
Forward
0 new messages