开发者

How to pass OpenSSL socket to another process

I want to pass the SSL socket(along with its SSL session) to another process. Is this possible ?

In the non-SSL socket implementation, I use WSADuplicateSocket(Windows API) to get socket info and then send it to another process to create a du开发者_C百科plicated socket.

How can I do this on SSL socket? Which information I has to pass to the second process to let them create the duplicated socket and continue the SSL session from the first process? Once the socket is passed to the second process, the first process will close its socket handle.


No, it is not possible. A socket is an OS object, which is why you can duplicate the socket handle in another process. OpenSSL, on the other hand, is an application-level library that just sits on top on whatever connection framework you decide to use for the physical communication. So you cannot duplicate the SSL structures and state machine that are attached to the original socket, as it cannot be shared across process boundaries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜