X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcarddav%2Fcarddav-contactlist.cpp;h=6990876d2131a9167ce16492223524a56a963b88;hb=7195b19cb9b6bac69a55acdffabaec237dc67e78;hp=16acdb5aaf30c4f88e6f4a3fcc2237b64cbb7eba;hpb=41edff01c68e3884c3ecd3ac904253b56783e44a;p=xestiaab%2F.git diff --git a/source/carddav/carddav-contactlist.cpp b/source/carddav/carddav-contactlist.cpp index 16acdb5..6990876 100644 --- a/source/carddav/carddav-contactlist.cpp +++ b/source/carddav/carddav-contactlist.cpp @@ -49,6 +49,12 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ wxString ServerAddressNormal; conn = curl_easy_init(); + +#if defined(__APPLE__) + + SetConnectionObject(conn); + +#endif struct CardDAVCURLPasser { @@ -66,7 +72,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 +154,10 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ curl_easy_setopt(conn, CURLOPT_HTTPHEADER, slist); curl_easy_setopt(conn, CURLOPT_CERTINFO, 1); +#if defined(__APPLE__) || defined(__WIN32__) + +#else + ServerCertFilename = GetAccountDir(ServerAccount, TRUE); if (wxFile::Exists(ServerCertFilename) == TRUE){ @@ -158,6 +168,8 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ } +#endif + curl_easy_setopt(conn, CURLOPT_POSTFIELDS, query); curl_easy_setopt(conn, CURLOPT_POSTFIELDSIZE, strlen(query)); @@ -208,6 +220,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 +326,8 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ curl_easy_cleanup(sslerrconn); } + +#endif // Sort out SSL error. @@ -345,6 +363,12 @@ 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);