Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding fix to allow https requests through http-proxy #281

Closed
wants to merge 1 commit into from
Closed

Adding fix to allow https requests through http-proxy #281

wants to merge 1 commit into from

Conversation

jbristow
Copy link
Contributor

@jbristow jbristow commented Apr 1, 2016

I need some eyes on it to a) figure out if I actually solved the problem and b) make sure I'm testing this right.

I can't get this to work in mitmproxy so I suspect I missed something. Either I haven't configured mitmproxy properly, or I've missed something else that needs to be changed.

@ptaoussanis
Copy link
Member

Hi Jon, thanks for your efforts. Could I perhaps ask for a short summary/reminder of what the particular problem is here that you're trying to address?

Are there other ways of addressing this problem? Is it necessary to mod http-kit?

Thanks!

@ptaoussanis
Copy link
Member

Update: just saw that this relates to #280

@jbristow
Copy link
Contributor Author

jbristow commented Apr 1, 2016

The main problem I saw is that when you connect to an http proxy with http-kit, (say it's on my-proxy:80) and then try to connect to https://www.google.com, the request is still marked as https, so this code fails:

// src/java/org/httpkit/client/HttpsRequest.java lines 135-141
    public void recycle(Request old) throws SSLException {
        super.recycle(old);
        this.engine = ((HttpsRequest) old).engine;
        this.handshaken = true;
        wrapRequest(); // prepare for write
    }

because the request is a Request object and cannot be cast.

ptaoussanis pushed a commit that referenced this pull request Jun 8, 2016
@jshaw86, @jbristow)

Squashed:
  - Adding fix to allow https requests through http-proxy
  - Added CONNECT header for http endpoints, add tunnel option for proxies that do not support CONNECT
  - proxy-host, proxy-port api changes
@ptaoussanis
Copy link
Member

Closing with #291

@ptaoussanis ptaoussanis closed this Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants