{"action":"created","issue":{"url":"https://api.github.com/repos/cherrypy/cherrypy/issues/1509","repository_url":"https://api.github.com/repos/cherrypy/cherrypy","labels_url":"https://api.github.com/repos/cherrypy/cherrypy/issues/1509/labels{/name}","comments_url":"https://api.github.com/repos/cherrypy/cherrypy/issues/1509/comments","events_url":"https://api.github.com/repos/cherrypy/cherrypy/issues/1509/events","html_url":"https://github.com/cherrypy/cherrypy/issues/1509","id":180462657,"number":1509,"title":"\"tlsv1 alert unknown ca\" for builtin SSL ","user":{"login":"Safihre","id":5703454,"avatar_url":"https://avatars.githubusercontent.com/u/5703454?v=3","gravatar_id":"","url":"https://api.github.com/users/Safihre","html_url":"https://github.com/Safihre","followers_url":"https://api.github.com/users/Safihre/followers","following_url":"https://api.github.com/users/Safihre/following{/other_user}","gists_url":"https://api.github.com/users/Safihre/gists{/gist_id}","starred_url":"https://api.github.com/users/Safihre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Safihre/subscriptions","organizations_url":"https://api.github.com/users/Safihre/orgs","repos_url":"https://api.github.com/users/Safihre/repos","events_url":"https://api.github.com/users/Safihre/events{/privacy}","received_events_url":"https://api.github.com/users/Safihre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-01T15:34:39Z","updated_at":"2016-10-02T00:47:58Z","closed_at":null,"body":"As described in #1497, there is still 1 bug left when using ```server.ssl_module: 'builtin'```.\r\n\r\nWhen Firefox connects for the **first time** to a server that has a self-signed certificate, FF will show the unsafe-server page, but on the server this happens (using unmodified CherryPy 8.1.0):\r\n```\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\user\\Documents\\GitHub\\sabnzbd\\cherrypy\\wsgiserver\\__init__.py\", line 1398, in communicate\r\n    req.parse_request()\r\n  File \"C:\\Users\\user\\Documents\\GitHub\\sabnzbd\\cherrypy\\wsgiserver\\__init__.py\", line 601, in parse_request\r\n    success = self.read_request_line()\r\n  File \"C:\\Users\\user\\Documents\\GitHub\\sabnzbd\\cherrypy\\wsgiserver\\__init__.py\", line 634, in read_request_line\r\n    request_line = self.rfile.readline()\r\n  File \"C:\\Users\\user\\Documents\\GitHub\\sabnzbd\\cherrypy\\wsgiserver\\__init__.py\", line 303, in readline\r\n    data = self.rfile.readline(256)\r\n  File \"C:\\Users\\user\\Documents\\GitHub\\sabnzbd\\cherrypy\\wsgiserver\\__init__.py\", line 1215, in readline\r\n    data = self.recv(self._rbufsize)\r\n  File \"C:\\Users\\user\\Documents\\GitHub\\sabnzbd\\cherrypy\\wsgiserver\\__init__.py\", line 1069, in recv\r\n    data = self._sock.recv(size)\r\n  File \"C:\\Python27\\lib\\ssl.py\", line 756, in recv\r\n    return self.read(buflen)\r\n  File \"C:\\Python27\\lib\\ssl.py\", line 643, in read\r\n    v = self._sslobj.read(len)\r\nSSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1754)\r\n```\r\nThis happens on both Python 2.7 and 3.5 on Win10 and Ubuntu.\r\nI created a patch ([link](https://github.com/Safihre/sabnzbd/commit/b7088d23d4e952a8cceffe9631ccf62cebfce41e#diff-c93ce94e61ff166711e8b913b7b20b72R1072)) for to catch this error, which will work on Python 2.7, but not on Python 3.5 since it doesn't use the ```CP_makefile_PY2```.\r\n\r\nMaybe you know a better solution which will also work on Python 3? \r\nMaybe wrap the ```self._sock.recv(size)``` function for the builtin SSL module to catch such errors?"},"comment":{"url":"https://api.github.com/repos/cherrypy/cherrypy/issues/comments/250946765","html_url":"https://github.com/cherrypy/cherrypy/issues/1509#issuecomment-250946765","issue_url":"https://api.github.com/repos/cherrypy/cherrypy/issues/1509","id":250946765,"user":{"login":"bb-migration","id":18138808,"avatar_url":"https://avatars.githubusercontent.com/u/18138808?v=3","gravatar_id":"","url":"https://api.github.com/users/bb-migration","html_url":"https://github.com/bb-migration","followers_url":"https://api.github.com/users/bb-migration/followers","following_url":"https://api.github.com/users/bb-migration/following{/other_user}","gists_url":"https://api.github.com/users/bb-migration/gists{/gist_id}","starred_url":"https://api.github.com/users/bb-migration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bb-migration/subscriptions","organizations_url":"https://api.github.com/users/bb-migration/orgs","repos_url":"https://api.github.com/users/bb-migration/repos","events_url":"https://api.github.com/users/bb-migration/events{/privacy}","received_events_url":"https://api.github.com/users/bb-migration/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T00:47:58Z","updated_at":"2016-10-02T00:47:58Z","body":"I'm not sure when I'll get the time to look at this. Feel free to devise a solution and we can evaluate it or roll it out for comment.\n"}}
{"actor":{"display_login":"bb-migration"}}