steffengy / schannel-rs

Schannel API-bindings for rust (provides an interface for native SSL/TLS using windows APIs)
MIT License
49 stars 51 forks source link

Allow the same SchannelCred to be used for multiple connections to support TLS session ticket resumption #67

Closed cyang1 closed 4 years ago

cyang1 commented 4 years ago

Adds an Arc within the SchannelCred, and slightly reworks the logic that uses it as a result. Not sure what to do about get_mut() at this point.

Added tests for the behavior by fetching the SECPKG_ATTR_SESSION_INFO attribute off the security context, which has information about whether the session was resumed.

Fixes #66.

steffengy commented 4 years ago

@cyang1 LGTM. and especially thanks for the tests 👍 . If you want, you can remove the Inner implementation for SchannelCred and move the relevant methods we use there to SchannelCred directly, so nobody can call the unimplemented get_mut method.