-
Notifications
You must be signed in to change notification settings - Fork 257
Description
Getting java.nio.channels.ClosedChannelException when calling the backend service in ssl way. When i connect through http of 8443, its working. Can you explain whats the issue and how to fix this?
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStorePath(keyStore);
sslContextFactory.setKeyStorePassword("changeit");
SSLEngineFactory myFactory = new DefaultFactories.SSLContextBasedFactory(sslContextFactory.getSslContext()) {
@OverRide
public SSLEngine createSSLEngine(ByteBufAllocator allocator) {
SSLEngine myEngine = super.createSSLEngine(allocator);
myEngine.setUseClientMode(true);
return myEngine;
}
};
return RxNetty.<ByteBuf, ByteBuf> newHttpClientBuilder(host, 443)
.withSslEngineFactory(myFactory).build();
.build();
Then invoking the request provides
return httpClient1.submit(request).doOnError(error -> {
System.out.println("Errrorrrrrrrrrrrrrrr : " + error.getMessage());
error.printStackTrace();
})
JDK version: 1.8
io.reactivex - 0.4.9
netty-all - 4.0.32.Final