Java JSSE SSLEngine cannot resume SSL session

ぃ、小莉子 提交于 2019-11-29 15:42:16

The SSLEngine will only resume sessions if you create it with SSLContext.createEngine(host, port). Otherwise it has no way of knowing who it's talking to, so no way of knowing what SSLSession to join.

SSLContext should be singleton. You can use netty 4.0.44.Final SslContextBuilder. Works resume session by sessionId.

private  SslContext sslContext;
...

if (serverSSLContext == null) {
    serverSSLContext = SslContextBuilder.forServer(new File("cert.crt"), new File("cert.key")).build();
}
channelPipeLine.addLast(serverSSLContext.newHandler(channelPipeLine.channel().alloc()));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!