Self Signed SSL backend
Is there a way to pass in a certificate file (similar to --cacert on curl) to validate a self-signed backend?
Not currently. You could probably do it creating a bean like so
@Bean
public Consumer<? super HttpClientOptions.Builder> nettyClientOptions() {
return opts -> {
opts.poolResources(PoolResources.elastic("proxy"));
// opts.disablePool(); //TODO: why do I need this again?
};
}
And setting the appropriate options on the netty http client.
Attempted this with little success.
@Bean
public Consumer<? super HttpClientOptions.Builder> nettyClientOptions() {
return opts -> {
opts.poolResources(PoolResources.elastic("proxy"));
SslContextBuilder builder = SslContextBuilder.forClient();
builder.clientAuth(ClientAuth.NONE);
builder.trustManager(InsecureTrustManagerFactory.INSTANCE);
try {
opts.sslContext(builder.build());
} catch (SSLException e) {
e.printStackTrace();
}
};
}
Yeah, you may have to actually override the HttpClient bean.
The snippet worked with 2.0 snapshot now, since the fix for URL rewrite SSL issue is there.
@spencergibb should the code that creates the http client be moved up to sc-commons? Similar to what we did with the apache and OK http clients?
No, I don't think so. Nothing else uses a netty HttpClient.
Closed via a2ca131b50a2a35308fe5274b1120ef9fe216d4b