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

Negotiation failure when using http proxying #312

Open
cylon opened this issue Jan 12, 2016 · 6 comments
Open

Negotiation failure when using http proxying #312

cylon opened this issue Jan 12, 2016 · 6 comments

Comments

@cylon
Copy link

cylon commented Jan 12, 2016

When running tomcat behind IIS or apache using http proxying, authentication randomly fails. When it fails multiple connections are being used during the negotation. Is there a way that waffle can deal with this?

client -------- server
connection 1
request ---->
<---- challenge
connection 2
handshake ----> waffle can't find connection
<----- reject

@cylon cylon changed the title Negotiation failure when using IIS & ARR Negotiation failure when using http proxying Jan 12, 2016
@dblock
Copy link
Collaborator

dblock commented Jan 12, 2016

Is the negotiation NTLM or Kerberos? NTLM is a connection-oriented protocol, so you need to maintain the same connection throughout the negotiation process.

@cylon
Copy link
Author

cylon commented Jan 14, 2016

It's using Kerberos, we've disabled NTLM, and a network trace confirms Kerberos. In WindowsAuthProviderImpl at line 104:

            continueContext = this.continueContexts.asMap().get(connectionId);

It fails right after that if it's not the same connection.

@vimil
Copy link
Contributor

vimil commented Jan 14, 2016

I think the issue is because the connectionId is the combination of ip address and port number of the proxy server and not the client server, so if multiple requests come in simultaneously from multiple clients in an interleaved fashion then I think the wrong continueContext gets used for authentication

Ex:

client 1 -------- proxyserver ------server
connection 1 - request ---->
waffle stores continueContext for connection1 in map

client 2 -------- proxyserver ------server
connection 2 - request ---->
waffle replaces continueContext for connection1 and stores continueContext for connection2 in map because proxyserver ip and port is same.

<---- connection 1 - challenge
handshake ----> waffle can't find connection because continueContext stored is for client 2 and not client 1

@dblock
Copy link
Collaborator

dblock commented Jan 14, 2016

Right, but shouldn't the proxy be a 1:1 mapping to client's connections in terms of sockets opened? Is it serving multiple clients on the same outgoing connection?

@vimil
Copy link
Contributor

vimil commented Jan 14, 2016

I see your point..

@cylon
Copy link
Author

cylon commented Jan 18, 2016

It appears that connections are pooled on the backend and may not be retained across requests. We see lots of requests succeed and then occasionally a new one is used mid handshake. I haven't found any configuration that would control that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants