Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Initial work started on using ConnectionObject on Win32 systems
[xestiaab/.git] / source / carddav2 / carddav2.cpp
index 536afac..2159b98 100644 (file)
@@ -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){
                
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy