{"action":"opened","issue":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/925","repository_url":"https://api.github.com/repos/mitmproxy/mitmproxy","labels_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/925/labels{/name}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/925/comments","events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/925/events","html_url":"https://github.com/mitmproxy/mitmproxy/issues/925","id":132733906,"number":925,"title":"Unexpected `flow.request.url` with `no-upstream-cert`","user":{"login":"arnau","id":33837,"avatar_url":"https://avatars.githubusercontent.com/u/33837?v=3","gravatar_id":"","url":"https://api.github.com/users/arnau","html_url":"https://github.com/arnau","followers_url":"https://api.github.com/users/arnau/followers","following_url":"https://api.github.com/users/arnau/following{/other_user}","gists_url":"https://api.github.com/users/arnau/gists{/gist_id}","starred_url":"https://api.github.com/users/arnau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnau/subscriptions","organizations_url":"https://api.github.com/users/arnau/orgs","repos_url":"https://api.github.com/users/arnau/repos","events_url":"https://api.github.com/users/arnau/events{/privacy}","received_events_url":"https://api.github.com/users/arnau/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-10T15:40:40Z","updated_at":"2016-02-10T15:40:40Z","closed_at":null,"body":"##### Steps to reproduce the problem:\r\n1. start mitmproxy with `no-upstream-cert` and an inline script (see below for the script).\r\n```mitmproxy --no-upstream-cert --script test.py```\r\n\r\n```python\r\n# test.py\r\ndef request(context, flow):\r\n  print(flow.request.url == \"https://google.com/\")\r\n```\r\n2. run\r\n```curl -XGET https://google.com/ \\\r\n          --cacert ~/.mitmproxy/mitmproxy-ca-cert.pem \\\r\n          --proxy http://localhost:8080\r\n```\r\n\r\n##### What is the expected behavior?\r\n\r\nThe printed result should be `True` (so `flow.request.url` should be `https://google.com/`).\r\n\r\nAlternatively, `flow.request.pretty_url` could have the original URL.\r\n\r\n##### What went wrong?\r\n\r\nThe result is `False` as `flow.request.url` == `http://google.com:443`.\r\n\r\n##### Any other comments?\r\n\r\nIn situations like `https://example.org:8443` the resulting `http://example.org:8443` is undistinguishable from a request to `http://example.org:8443`.\r\n\r\nIf it is not a bug (I'm not sure it is intended to be the way it is) it would be great to query the original requested URL.\r\n\r\n---\r\nmitmproxy version: 0.15\r\nOperating System: OSX Yosemite 10.10.5\r\nPython: 2.7.11"}}