HttpDestination can now be told to use cleartext even when the scheme is secure
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
parent
c19988af28
commit
16cbcc0e4f
|
@ -22,6 +22,6 @@ public class DuplexHttpDestination extends HttpDestination
|
|||
{
|
||||
public DuplexHttpDestination(HttpClient client, Origin origin)
|
||||
{
|
||||
super(client, origin);
|
||||
super(client, origin, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public abstract class HttpDestination extends ContainerLifeCycle implements Dest
|
|||
private final RequestTimeouts requestTimeouts;
|
||||
private ConnectionPool connectionPool;
|
||||
|
||||
public HttpDestination(HttpClient client, Origin origin)
|
||||
public HttpDestination(HttpClient client, Origin origin, boolean intrinsicallySecure)
|
||||
{
|
||||
this.client = client;
|
||||
this.origin = origin;
|
||||
|
@ -85,12 +85,12 @@ public abstract class HttpDestination extends ContainerLifeCycle implements Dest
|
|||
if (proxy != null)
|
||||
{
|
||||
connectionFactory = proxy.newClientConnectionFactory(connectionFactory);
|
||||
if (proxy.isSecure())
|
||||
if (!intrinsicallySecure && proxy.isSecure())
|
||||
connectionFactory = newSslClientConnectionFactory(proxy.getSslContextFactory(), connectionFactory);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isSecure())
|
||||
if (!intrinsicallySecure && isSecure())
|
||||
connectionFactory = newSslClientConnectionFactory(null, connectionFactory);
|
||||
}
|
||||
Object tag = origin.getTag();
|
||||
|
@ -142,9 +142,7 @@ public abstract class HttpDestination extends ContainerLifeCycle implements Dest
|
|||
|
||||
public boolean isSecure()
|
||||
{
|
||||
return false;
|
||||
// TODO: restore this, but ATM this breaks cleartext HTTP over QUIC
|
||||
// return HttpClient.isSchemeSecure(getScheme());
|
||||
return HttpClient.isSchemeSecure(getScheme());
|
||||
}
|
||||
|
||||
public HttpClient getHttpClient()
|
||||
|
|
|
@ -28,7 +28,12 @@ public class MultiplexHttpDestination extends HttpDestination implements HttpDes
|
|||
{
|
||||
public MultiplexHttpDestination(HttpClient client, Origin origin)
|
||||
{
|
||||
super(client, origin);
|
||||
this(client, origin, false);
|
||||
}
|
||||
|
||||
public MultiplexHttpDestination(HttpClient client, Origin origin, boolean intrinsicallySecure)
|
||||
{
|
||||
super(client, origin, intrinsicallySecure);
|
||||
}
|
||||
|
||||
@ManagedAttribute(value = "The maximum number of concurrent requests per connection")
|
||||
|
|
|
@ -69,7 +69,7 @@ public class HttpClientTransportOverQuic extends AbstractHttpClientTransport
|
|||
@Override
|
||||
public HttpDestination newHttpDestination(Origin origin)
|
||||
{
|
||||
return new MultiplexHttpDestination(getHttpClient(), origin);
|
||||
return new MultiplexHttpDestination(getHttpClient(), origin, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -64,7 +64,7 @@ public class ConnectionPoolsBenchmark
|
|||
promise.succeeded(new MockConnection());
|
||||
}
|
||||
};
|
||||
HttpDestination httpDestination = new HttpDestination(httpClient, new Origin("http", "localhost", 8080))
|
||||
HttpDestination httpDestination = new HttpDestination(httpClient, new Origin("http", "localhost", 8080), false)
|
||||
{
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue