Skip to content

java.nio.channels.ClosedChannelException #586

@JanakiramanChandrasekran

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions