cherrypy requires ssl to startup

Anonymous avatarAnonymous 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:

  1. 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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.