Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Fixes for
Browse files Browse the repository at this point in the history
adamfisk#336 - short circuit response removing auth challenge.
adamfisk#337 - SNI headers not being sent for outbound proxies.
  • Loading branch information
techpavan committed Jan 5, 2017
1 parent 14ceb97 commit f32c881
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>org.littleshoot</groupId>
<artifactId>littleproxy</artifactId>
<packaging>jar</packaging>
<version>1.1.1-ntlm-20161219</version>
<version>1.1.1-ntlm-20170105</version>
<name>LittleProxy</name>
<description>
LittleProxy is a high performance HTTP proxy written in Java and using the Netty networking framework.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,8 @@ private boolean respondWithShortCircuitResponse(HttpResponse httpResponse) {

// if the response is not a Bad Gateway or Gateway Timeout, modify the headers "as if" the short-circuit response were proxied
int statusCode = httpResponse.getStatus().code();
if (statusCode != HttpResponseStatus.BAD_GATEWAY.code() && statusCode != HttpResponseStatus.GATEWAY_TIMEOUT.code()) {
if (statusCode != HttpResponseStatus.BAD_GATEWAY.code() && statusCode != HttpResponseStatus.GATEWAY_TIMEOUT.code()
&& statusCode != HttpResponseStatus.PROXY_AUTHENTICATION_REQUIRED.code()) {
modifyResponseHeadersToReflectProxying(httpResponse);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.littleshoot.proxy.UnknownTransportProtocolException;
import org.littleshoot.proxy.ntlm.NtlmException;

import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLProtocolException;
import javax.net.ssl.SSLSession;
import java.io.IOException;
Expand Down Expand Up @@ -602,8 +603,10 @@ private void initializeConnectionFlow() {
.then(ConnectChannel);

if (chainedProxy != null && chainedProxy.requiresEncryption()) {
connectionFlow.then(serverConnection.EncryptChannel(chainedProxy
.newSslEngine()));
InetSocketAddress proxyAddress = chainedProxy.getChainedProxyAddress();
SSLEngine engine = chainedProxy.newSslEngine(proxyAddress.getHostName(), proxyAddress.getPort());
engine = engine == null ? chainedProxy.newSslEngine() : engine;
connectionFlow.then(serverConnection.EncryptChannel(engine));
}

if (chainedProxy != null && chainedProxy.getNtlmHandler() != null) {
Expand Down

0 comments on commit f32c881

Please sign in to comment.