Java 中基于 JSSE 的 SSL 套接字可以并行执行读/写吗?
最常用的 SSL 'C' 实现 (OpenSSL) 不支持对其 SSL 会话进行并行操作。 (即您不能对同一会话并行执行 SSL_read 和 SSL_write)。
Java基础的SSL、JSSE支持这个功能吗?即对于使用 JSSE 创建的同一个 SSL 会话,我可以在不同线程上并行读写吗?如果是,它是否也无缝处理重新协商(即,如果从另一方收到重新协商请求,它会被处理吗?)
因为,我对Java知之甚少或根本不了解,所以我还有另一个非常基本的问题,是吗?可以从Java中的同一套接字的不同线程并行读/写吗?
The most commonly used 'C' Implementation of SSL (OpenSSL) doesn't support parallely operations on it's SSL Session. (i.e. You cannot do a SSL_read & SSL_write) parallely for the same session.
Does the Java bases SSL, JSSE support this feature? i.e. For the same SSL Session created using JSSE, can I do read and write parallely on different threads? If yes, does it also handle renegotiation seamlessly (i.e. if a renegotiation request is received from the other side, will it be handled?)
Since, I have very little or no idea of Java, I have another very basic question also, Is it possible to do read / write parallely from different threads for the same socket in Java?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,SSLSockets和Sockets可以由单独的线程读写;是的,SSLSocket 可以无缝地处理重新协商。
您对“会话”的使用不太正确。每个 SSL 会话可以有多个 SSLSocket(和 openSSL 套接字)。在Java中它们都可以独立使用。
Yes, SSLSockets and Sockets can be read and written by separate threads; yes an SSLSocket handles renegotiation seamlessly.
Your use of 'session' isn't quite right. You can have multiple SSLSockets (and openSSL sockets) per SSL session. In Java they can all be used independently.