yuyang
yuyang

Reputation: 1651

How to create a ssl serversocket using netty library

We have the following code to create a ssl serversocket using javax.net.ssl:

private final ServerSocket serverSocket;
private final SslFactory sslFactory;
...
SSLContext sslContext = this.sslFactory.sslContext();
this.serverSocket = sslContext.getServerSocketFactory().createServerSocket(0);

We need to change this code in order to use the netty ssl client lib instead. Could anyone tell how do we create a serversocket using netty lib, assume that we have an io.netty.handler.ssl.SslContext object. I have tried to search online, but did not succeed in finding the answer.

Upvotes: 0

Views: 298

Answers (1)

Norman Maurer
Norman Maurer

Reputation: 23567

To make it short its not possible as netty does use non-blocking IO while you want to use a ServerSocket which uses blocking IO.

Upvotes: 2

Related Questions