Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Altered CardDAV object to accommodate for SSL support for OS X (and other OSes in...
[xestiaab/.git] / source / carddav / carddav-contactlist.cpp
index 16acdb5..6c909ae 100644 (file)
@@ -49,6 +49,10 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
        wxString ServerAddressNormal;
 
        conn = curl_easy_init();
+
+#if defined(__APPLE__)
+       SetConnectionObject(conn);
+#endif
        
        struct CardDAVCURLPasser {
        
@@ -66,7 +70,7 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
        wxString Data1;
        wxString Data2;
        
-       ServerAddressURL = ServerAddress + wxT(":") + wxString::Format(wxT("%i"), ServerPort) + wxT("/") + ServerPrefix + wxT("/");
+       ServerAddressURL = ServerAddress + wxT(":") + wxString::Format(wxT("%i"), ServerPort) + ServerPrefix;
        ServerAddressSSL = wxT("https://") + ServerAddressURL;
        ServerAddressNormal = wxT("http://") + ServerAddressURL;
        
@@ -148,6 +152,10 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
                curl_easy_setopt(conn, CURLOPT_HTTPHEADER, slist);
                curl_easy_setopt(conn, CURLOPT_CERTINFO, 1);
 
+#if defined(__APPLE__)
+               
+#else
+               
                ServerCertFilename = GetAccountDir(ServerAccount, TRUE);
 
                if (wxFile::Exists(ServerCertFilename) == TRUE){
@@ -158,6 +166,8 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
                
                }
 
+#endif
+               
                curl_easy_setopt(conn, CURLOPT_POSTFIELDS, query);
                curl_easy_setopt(conn, CURLOPT_POSTFIELDSIZE, strlen(query));
 
@@ -208,6 +218,10 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
                // Check if it fails with a CURLE_SSL_CACERT then compare
                // the certificates as PEM files.
                
+#if defined(__APPLE__)
+
+#else
+               
                if (claconncode == CURLE_SSL_CACERT && wxFile::Exists(ServerCertFilename) == TRUE){
 
                        CURL *sslerrconn;
@@ -310,6 +324,8 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
                        curl_easy_cleanup(sslerrconn);
                
                }
+               
+#endif
 
                // Sort out SSL error.
                
@@ -345,6 +361,10 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
                        curl_easy_setopt(sslerrconn, CURLOPT_SSL_VERIFYPEER, 0);
                        curl_easy_setopt(sslerrconn, CURLOPT_CERTINFO, 1);
                
+#if defined(__APPLE__)
+                       SetConnectionObject(sslerrconn);
+#endif
+                       
                        sslerrconncode = (curl_easy_perform(sslerrconn));
 
                        SSLCertCol = BuildSSLCollection(sslerrconn);
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