{"action":"created","issue":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/848","labels_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/848/labels{/name}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/848/comments","events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/848/events","html_url":"https://github.com/mitmproxy/mitmproxy/issues/848","id":119535840,"number":848,"title":"Requesting complete URL over https proxy results in \"Invalid request scheme: https\"","user":{"login":"copumpkin","id":2623,"avatar_url":"https://avatars.githubusercontent.com/u/2623?v=3","gravatar_id":"","url":"https://api.github.com/users/copumpkin","html_url":"https://github.com/copumpkin","followers_url":"https://api.github.com/users/copumpkin/followers","following_url":"https://api.github.com/users/copumpkin/following{/other_user}","gists_url":"https://api.github.com/users/copumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/copumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copumpkin/subscriptions","organizations_url":"https://api.github.com/users/copumpkin/orgs","repos_url":"https://api.github.com/users/copumpkin/repos","events_url":"https://api.github.com/users/copumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/copumpkin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-30T17:05:40Z","updated_at":"2015-11-30T20:05:54Z","closed_at":null,"body":"##### Steps to reproduce the problem:\r\n1. Set up an HTTPS mitmproxy\r\n2. Run the following (minimized) code against it:\r\n```python\r\nimport httplib\r\nconn = httplib.HTTPSConnection('<your proxy IP>',<your proxy port>)\r\nconn.set_tunnel('www.google.com',443)\r\nconn.request('GET','https://www.google.com:443/')\r\nresp = conn.getresponse()\r\nprint resp.read()\r\n```\r\n\r\n##### What is the expected behavior?\r\n\r\n```html\r\n<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\r\n<TITLE>301 Moved</TITLE></HEAD><BODY>\r\n<H1>301 Moved</H1>\r\nThe document has moved\r\n<A HREF=\"http://www.google.com/\">here</A>.\r\n</BODY></HTML>\r\n```\r\n\r\n##### What went wrong?\r\n\r\n```html\r\n<html>\r\n            <head>\r\n                <title>400 Bad Request</title>\r\n            </head>\r\n            <body>HttpException('Invalid request scheme: https',)</body>\r\n        </html>\r\n```\r\n\r\n##### Any other comments?\r\n\r\nI believe it's caused by a combination of https://github.com/mitmproxy/mitmproxy/blob/master/libmproxy/protocol/http.py#L544-L545 and https://github.com/mitmproxy/mitmproxy/blob/master/libmproxy/protocol/http.py#L502-L503. Indeed, if you modify my `GET` request above to ask for just `/` instead of `https://www.google.com:443/`, everything works fine.\r\n\r\nI'm not sure if it's sensible to support absolute-form requests over https tunnels, but I'm getting this behavior in real code (boto for python AWS) so I don't think it's very a contrived situation.\r\n\r\n---\r\nmitmproxy version: 0.14.0"},"comment":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/comments/160743268","html_url":"https://github.com/mitmproxy/mitmproxy/issues/848#issuecomment-160743268","issue_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/848","id":160743268,"user":{"login":"copumpkin","id":2623,"avatar_url":"https://avatars.githubusercontent.com/u/2623?v=3","gravatar_id":"","url":"https://api.github.com/users/copumpkin","html_url":"https://github.com/copumpkin","followers_url":"https://api.github.com/users/copumpkin/followers","following_url":"https://api.github.com/users/copumpkin/following{/other_user}","gists_url":"https://api.github.com/users/copumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/copumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copumpkin/subscriptions","organizations_url":"https://api.github.com/users/copumpkin/orgs","repos_url":"https://api.github.com/users/copumpkin/repos","events_url":"https://api.github.com/users/copumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/copumpkin/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T20:05:54Z","updated_at":"2015-11-30T20:05:54Z","body":"I attempted a naive patch to remove the check for `http` and the check right below it for expected form but that just led to a 400 error elsewhere."}}