Support Authorization with Proxy server (in client) #1213

Open
ktoso opened this Issue Jun 20, 2017 · 3 comments

Comments

Projects
None yet
3 participants
Owner

ktoso commented Jun 20, 2017

In #1200 (comment) we implemented HTTP(S) proxy support, however we did not yet implement authorization support, this ticket is to address that.

Owner

ktoso commented Jun 20, 2017

FYI @note

Contributor

Scalahansolo commented Jun 28, 2017

After giving this a couple shots I am getting lost trying to implement this. Until I have time to do some more digging, I don't quite have the knowledge necessary to figure out how to pass the proxy auth header after the proxy responds with a 407. I also don't have the greatest understanding of how BiDi flows work, which I am now trying to level up on.

Member

jrudolph commented Jun 29, 2017

Actually, I would send the authorization data proactively before the proxy can even respond with 407. After it has responded it might even be impossible to use CONNECT on the same connection again. I'd say that retrying CONNECT on another connection is currently out of scope.

Basically, how the thing should work is by adding optional credentials (could be of type HttpCredentials to support all kinds of credentials even if basic authorization is probably the most common one?) to the httpsProxy constructor and passing them on to the stage. In the stage, the initial CONNECT request is currently built using string manipulation. For now, it would be ok to add the authentication header there manually by string as well. You should probably create an instance of model.headers.Proxy-Authorization with the credentials and use its render method with a StringRendering to render the header.

Does that explanation make sense. Hopefully that would be enough for a first cut.

@jrudolph jrudolph added a commit to jrudolph/akka-http that referenced this issue Jul 18, 2017

@jrudolph Sean Callahan + jrudolph +htc #1213 allow adding proxy auth headers to httpsProxy bffe928

@jrudolph jrudolph added a commit to jrudolph/akka-http that referenced this issue Jul 18, 2017

@jrudolph Sean Callahan + jrudolph +htc #1213 allow adding proxy auth headers to httpsProxy ce8fe54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment