X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcarddav2%2Fcarddav2.cpp;h=2159b989702346034936db97dde64f2aa04c2ebc;hp=536afacb50eed59e09ee1d629aa5c93325cd8f9c;hb=a578ed436123242f807cb59eae02fcf6c22e2458;hpb=2c8998278759b5bf6fc3bcf75afd289c214b6c84 diff --git a/source/carddav2/carddav2.cpp b/source/carddav2/carddav2.cpp index 536afac..2159b98 100644 --- a/source/carddav2/carddav2.cpp +++ b/source/carddav2/carddav2.cpp @@ -54,8 +54,7 @@ size_t CardDAV2::WritebackFuncImplementation(char *ptr, size_t size, size_t nmem const struct curl_tlssessioninfo *TLSInfo; CURLcode TLSCode; - CURL *Connection = GetConnectionObject(); - TLSCode = curl_easy_getinfo(Connection, CURLINFO_TLS_SSL_PTR, &TLSInfo); + TLSCode = curl_easy_getinfo(ConnectionSession, CURLINFO_TLS_SSL_PTR, &TLSInfo); if (TLSInfo->internals != nullptr && TLSCode == CURLE_OK){ @@ -85,6 +84,12 @@ CardDAV2::~CardDAV2(){ curl_slist_free_all(HeaderList); HeaderList = nullptr; } + +#if defined(__WIN32__) + + CertFreeCertificateContext(CertificateData); + +#endif } @@ -92,6 +97,12 @@ CardDAV2::~CardDAV2(){ #elif defined(__WIN32__) +PCCERT_CONTEXT CardDAV2::BuildSSLCollection(){ + + return CertificateData; + +} + #else SSLCertCollectionString CardDAV2::BuildSSLCollection(){ @@ -1379,6 +1390,8 @@ void CardDAV2::SetupDefaultParametersSSL(bool DoAuthentication){ curl_easy_setopt(ConnectionSession, CURLOPT_USERPWD, ":"); } +#if !defined(__WIN32__) + if (EnableSSLBypass == true){ curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYHOST, 0); curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYPEER, 0); @@ -1386,6 +1399,8 @@ void CardDAV2::SetupDefaultParametersSSL(bool DoAuthentication){ curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYHOST, 2); curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYPEER, 1); } + +#endif if (TestMode == false && ServerAccount.size() > 0){