开发者

Can I get a SOCKET using SChannel?

开发者 https://www.devze.com 2022-12-28 22:36 出处:网络
I\'d like to use SChannel or some other Microsoft API to support TLS for my TCP/IP application.Ideally what I\'d like to do is use SChannel to create a kind of TLS tunnel within my app so I can pass o

I'd like to use SChannel or some other Microsoft API to support TLS for my TCP/IP application. Ideally what I'd like to do is use SChannel to create a kind of TLS tunnel within my app so I can pass off a SOCKET handle to another library. Is this something S开发者_如何学PythonChannel can do for me or do I have to implement the tunnel myself?


SChannel does not create its own SOCKET, it operates on top of your own SOCKET. If you pass your SChannel SOCKET to another library, it will have direct access to the underlying TCP/IP connection, bypassing SChannel altogether. It sounds like what you are looking for is to create two SOCKETs - one to communicate securely with a remote peer, and one to communicate unsecurely with the local library, and then manually pass data between the two in your code as needed.

0

精彩评论

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

关注公众号