I did try the changes discussed in that thread to the files _cpserver.py,
_cpwsgi_server.py, and wsgiserver\__init_.py but it still did not work for
me. With those changes applied I get the following startup messages:
[01/Oct/2009:14:32:02] ENGINE Started monitor thread '_TimeoutMonitor'.
[01/Oct/2009:14:32:02] ENGINE Started monitor thread 'Autoreloader'.
[01/Oct/2009:14:32:03] ENGINE Serving on 0.0.0.0:8443
[01/Oct/2009:14:32:03] ENGINE Serving on 0.0.0.0:8080
[01/Oct/2009:14:32:03] ENGINE Bus STARTED
Yet when I navigate to http://localhost:8080 or https://localhost:8443 I get
101 errors (ERR_CONNECTION_RESET)
This is just with a small sample app:
import cherrypy
from cherrypy import _cpserver
import os.path
localDir = os.path.abspath(os.path.dirname(__file__))
CA = os.path.join(localDir, 'server.crt')
KEY = os.path.join(localDir, 'server.key')
def setup_app():
class Root(object):
@cherrypy.expose
def index(self):
return "Here is a page"
cherrypy.tree.mount(Root())
if __name__ == '__main__':
cherrypy.server2 = s2 = _cpserver.Server()
s2.socket_host = '0.0.0.0'
s2.socket_port = 8443
s2.ssl_certificate = CA
s2.ssl_private_key = KEY
s2.subscribe()
cherrypy.server.socket_host = '0.0.0.0'
setup_app()
cherrypy.engine.start()
cherrypy.engine.block()
As a matter of fact, I can't even connect a single server application when I
apply the changes discussed in the aforementioned thread ( I must have
missed something, it seemed to work for them).
Eventually I wish to have pages served via HTTP and web services (WSGI Apps)
served over HTTPS, but I can't get even a simple app working.
Can anyone provide suggestions?
--
View this message in context: http://www.nabble.com/Multiple-Ports-and-SSL-tp25704449p25704449.html
Sent from the cherrypy-users mailing list archive at Nabble.com.
"The client sent a plain HTTP request, but this server only speaks HTTPS on
this port."
So internally cherrypy is using ssl on each server:port combination. If I
navigate to either https://localhost:8080 or https://localhost:8443 I get
the expected page over ssl. Am I using cherrypy in an incorrect manner or
is this a bug?
--
View this message in context: http://www.nabble.com/Multiple-Ports-and-SSL-tp25704449p25716501.html
A bug. Fixed in http://www.cherrypy.org/changeset/2536.
Incidentally, you should be able to use the new 'server.<name>.*'
attributes to do this more easily. See the 'scaffold' app in 3.2 for a
working example (just added):
[global]
# Uncomment this when you're done developing
#environment: "production"
server.socket_host: "0.0.0.0"
server.socket_port: 8088
# Uncomment the following lines to run on HTTPS at the same time
#server.2.socket_host: "0.0.0.0"
#server.2.socket_port: 8433
#server.2.ssl_certificate: '../test/test.pem'
#server.2.ssl_private_key: '../test/test.pem'
tree.myapp: cherrypy.Application(scaffold.root, "/", "example.conf")
Robert Brewer
fuma...@aminus.org