我正在使用 Java 8 NIO 和 SSL 实现客户端和服务器部分。 我对创建 SSLEngine 有一些疑问。
SSLContext中有一个方法
public final SSLEngine createSSLEngine(String peerHost,
int peerPort)
Applications using this factory method are providing hints for an internal session reuse strategy.
在客户端创建 SSLEngine 时,我必须提供服务器的 IP 和端口。 但是在服务器端创建 SSLEngine 时,我应该给出哪个 IP 和端口?
根据 RFC2246,客户端必须在 ClientHello 消息中发送“ session ID”,服务器将检查其“ session 缓存”是否匹配。 我该如何对服务器的 SSLEngine 启用“ session 缓存”?
最佳答案
While creating the SSLEngine at client side, I have to give server's ip and port. But while creating SSLEngine at server side, which IP and port I should give ?
客户的。
As per RFC2246, the client has to send "Session ID" in ClientHello Message, and Server will check its "Session Cache" for its match. How would I say to server's SSLEngine to enable "Session cache"?
只要服务器端 SSLEngine
知道客户端 IP:端口,它就会默认开启。
关于Java NIO SSL - SSLEngine session 重用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29935644/