ReactiveX / RxNetty

Reactive Extension (Rx) Adaptor for Netty
Apache License 2.0
1.38k stars 255 forks source link

java.nio.channels.ClosedChannelException #586

Open JanakiramanChandrasekran opened 7 years ago

JanakiramanChandrasekran commented 7 years ago

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