Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.nio.channels.ClosedChannelException #586

Open
JanakiramanChandrasekran opened this issue May 30, 2017 · 0 comments
Open

java.nio.channels.ClosedChannelException #586

JanakiramanChandrasekran opened this issue May 30, 2017 · 0 comments

Comments

@JanakiramanChandrasekran

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant