Issue #1083 resolved

cherrypy requires ssl to startup

Anonymous created an issue

On upgrading from 3.2.0.rc1 to 3.2.0, I found that the _cpcompat file imports HTTPSConnection from httplib (python 2.7). This obviously fails if ssl isn't present, which may be the case in embedded scenarios. Also, this goes against checks elsewhere that detect the presence of ssl (e.g. wsgiserver.ssl_builtin Can be fixed by conditionally importing these components, e.g. I currently have this change:

CCP Change, make it work without ssl support

try:
    from httplib import HTTPSConnection
except ImportError:
    pass

Reported by kristjan@ccpgames.com

Comments (6)

  1. Joel Rivera

    grisevg do you remember what was the comment?, I won't see anyone.

    The current implementation is like this:

    if py3k:
        try:
            from http.client import HTTPSConnection
        except ImportError:
            # Some platforms which don't have SSL don't expose HTTPSConnection                                                                                                                      
            HTTPSConnection = None
    else:
        try:
            from httplib import HTTPSConnection
        except ImportError:
            HTTPSConnection = None
    
  2. Log in to comment