Windows :: Web :: Http :: HttpClient - 重新协商SSL握手

时间:2015-04-16 02:17:24

标签: c++ ssl windows-phone-8.1 c++-cx

作为我的Windows手机应用程序的一部分,我使用Windows::Web::Http::HttpClient将请求发布到服务器。我试过了 -

void sendRequest(HttpRequestMessage^ httpReqMsg)
{
    HttpBaseProtocolFilter^ httpFilter = ref new HttpBaseProtocolFilter();
    httpFilter->CacheControl->WriteBehavior = HttpCacheWriteBehavior::NoCache;

    HttpClient^ httpClient = ref new HttpClient(httpFilter);

    try
    {
        // Post the request
        auto httpProgress = httpClient->SendRequestAsync(httpReqMsg);

        // Handle the http progress and it's response messages
        // ...
    }
    catch(Exception^ ex)
    {
        // ...
    }

} // httpFilter, httpClient are auto released

httpFilter, httpClient超出范围时,我希望应该释放底层套接字和内存资源。在通话HttpClient::SendRequestAsync期间,我看到第一次发生SSL协商。对sendRequest函数的任何进一步调用都不会触发完全握手。

我不允许加载任何DLL以明确清除SSL缓存(SslEmptyCache)。我的假设是否正确,每次调用sendRequest函数时都应该进行完全握手?如果没有,如何实现完整的SSL握手?感谢。

0 个答案:

没有答案