{"action":"created","issue":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1007","repository_url":"https://api.github.com/repos/mitmproxy/mitmproxy","labels_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1007/labels{/name}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1007/comments","events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1007/events","html_url":"https://github.com/mitmproxy/mitmproxy/issues/1007","id":138891188,"number":1007,"title":"Https connection to non-exisiting url has status code 200 instead of 502","user":{"login":"IchbinkeinReh","id":12527468,"avatar_url":"https://avatars.githubusercontent.com/u/12527468?v=3","gravatar_id":"","url":"https://api.github.com/users/IchbinkeinReh","html_url":"https://github.com/IchbinkeinReh","followers_url":"https://api.github.com/users/IchbinkeinReh/followers","following_url":"https://api.github.com/users/IchbinkeinReh/following{/other_user}","gists_url":"https://api.github.com/users/IchbinkeinReh/gists{/gist_id}","starred_url":"https://api.github.com/users/IchbinkeinReh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IchbinkeinReh/subscriptions","organizations_url":"https://api.github.com/users/IchbinkeinReh/orgs","repos_url":"https://api.github.com/users/IchbinkeinReh/repos","events_url":"https://api.github.com/users/IchbinkeinReh/events{/privacy}","received_events_url":"https://api.github.com/users/IchbinkeinReh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-07T05:27:59Z","updated_at":"2016-03-07T10:32:21Z","closed_at":null,"body":"##### Steps to reproduce the problem:\r\n1. Run mitmdump\r\n2. Visit some non-existing host with https (e.g https://abc123.org/) in browser that uses the mitmdump proxy\r\n\r\n##### What is the expected behavior?\r\nStatus code 502\r\n\r\n##### What went wrong?\r\nI get status code 200 with the following content:\r\n```\r\n<html>\r\n            <head>\r\n                <title>502 Bad Gateway</title>\r\n            </head>\r\n            <body>ProtocolException('Server connection to abc123.org:443 failed: Error connecting to \"abc123.org\": [Errno 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte',)</body>\r\n        </html>\r\n```\r\nWhen i try to visit a non-existing host with http (e.g. https://abc123.org/) everything works as expected. I get status code 502 with the same content as above.\r\n\r\n---\r\n\r\nMitmproxy Version: 0.16\r\nOperating System: Windows 10 64bit"},"comment":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/comments/193197727","html_url":"https://github.com/mitmproxy/mitmproxy/issues/1007#issuecomment-193197727","issue_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1007","id":193197727,"user":{"login":"IchbinkeinReh","id":12527468,"avatar_url":"https://avatars.githubusercontent.com/u/12527468?v=3","gravatar_id":"","url":"https://api.github.com/users/IchbinkeinReh","html_url":"https://github.com/IchbinkeinReh","followers_url":"https://api.github.com/users/IchbinkeinReh/followers","following_url":"https://api.github.com/users/IchbinkeinReh/following{/other_user}","gists_url":"https://api.github.com/users/IchbinkeinReh/gists{/gist_id}","starred_url":"https://api.github.com/users/IchbinkeinReh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IchbinkeinReh/subscriptions","organizations_url":"https://api.github.com/users/IchbinkeinReh/orgs","repos_url":"https://api.github.com/users/IchbinkeinReh/repos","events_url":"https://api.github.com/users/IchbinkeinReh/events{/privacy}","received_events_url":"https://api.github.com/users/IchbinkeinReh/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T10:32:21Z","updated_at":"2016-03-07T10:32:21Z","body":"Ok maybe this is not a bug in mitmproxy. I found that the status code is 200 in Firefox, but Chrome correctly shows 502."}}