如何清除客户端.Net SSL会话缓存 [英] How to clear the client-side .Net SSL session cache
问题描述
我正在编写一个小的测试工具,该工具使用HttpWebRequest对服务器进行负载测试。我想每次尝试调用HttpWebRequest.GetResponse()时都为
建立一个新的SSL会话,而不是在缓存中使用它。注意:我提供了一个客户端证书,并且为SSL会话使用了相互身份验证。
I am writing a little test tool, which uses HttpWebRequest to load test a server. I want for each time I try to call HttpWebRequest.GetResponse() for it establish a fresh SSL session instead of using the one in the cache. Note: I am supplying a client certificate, and using Mutual Authentication for the SSL Session.
是否可以清除 http://msdn.microsoft.com/en-us/library/system .net.httpwebrequest.clientcertificates.aspx ?
推荐答案
我认为您正在寻找HttpRequestCacheLevel枚举值NoCacheNoStore
I think you're looking for the HttpRequestCacheLevel Enumeration value NoCacheNoStore
http://msdn.microsoft.com/zh-cn/library/system.net.cache.httprequestcachelevel.aspx
然后您可以覆盖HttpRequestCachePolicy
You can then overwrite the HttpRequestCachePolicy
http://msdn.microsoft.com/en-us/library/system.net.webrequest.cachepolicy.a spx
这篇关于如何清除客户端.Net SSL会话缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!