Problem implementing django-sslserver

181 views
Skip to first unread message

pythonista

unread,
Nov 26, 2014, 1:07:52 PM11/26/14
to django...@googlegroups.com


The application was working successfully on the Linux server.

I am trying to implement the ssl functionality and getting the  stack trace below after following the instructions

Any suggestions as to what is going on and how to fix this.

We are running the dev server with a separate Apache server acting as a proxy.

The comnmand line is

$ python manage.py runsslserver --certificate /path/to/certificate.crt --key /path/to/key.key  ip_adress:8020

Thanks

 

[26/Nov/2014 10:38:24] "GET /waitlist/ HTTP/1.1" 200 6341
[26/Nov/2014 11:30:50] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x00C\x01\x00\x00?\x03\x01Tv\x0eJ\xb2\xecd\x1f\xf5)\xd3\x8a\x9a4\xa5\x8c\xd3U;\x04C')
Traceback (most recent call last):
  File "/opt/python-2.7.8/lib/python2.7/SocketServer.py", line 595, in process_request_thread
    self.finish_request(request, client_address)
  File "/opt/python-2.7.8/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/servers/basehttp.py", line 129, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "/opt/python-2.7.8/lib/python2.7/SocketServer.py", line 651, in __init__
    self.handle()
  File "/opt/python-2.7.8/lib/python2.7/wsgiref/simple_server.py", line 117, in handle
    if not self.parse_request(): # An error code has been sent, just exit
  File "/opt/python-2.7.8/lib/python2.7/BaseHTTPServer.py", line 281, in parse_request
    "Bad HTTP/0.9 request type (%r)" % command)
  File "/opt/python-2.7.8/lib/python2.7/BaseHTTPServer.py", line 368, in send_error
    self.send_response(code, message)
  File "/opt/python-2.7.8/lib/python2.7/BaseHTTPServer.py", line 385, in send_response
    self.log_request(code)
  File "/opt/python-2.7.8/lib/python2.7/BaseHTTPServer.py", line 422, in log_request
    self.requestline, str(code), str(size))
  File "/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/servers/basehttp.py", line 136, in log_message
    msg = "[%s] %s\n" % (self.log_date_time_string(), format % args)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 16: ordinal not in range(128)


Collin Anderson

unread,
Nov 30, 2014, 12:54:11 PM11/30/14
to django...@googlegroups.com
Hi,

A few things.

The stacktrace looks like it's getting gibberish. Maybe your cert and key don't match?

When I try, I can't get it to listen on a different port number. (It looks like you're trying to have it listen on 8020)

Why not have apache (or nginx) handle the SSL for you?

Collin
Reply all
Reply to author
Forward
0 new messages