wxString ServerAddressURL;
wxString ServerAuth;
wxString ServerAddressSSL;
- wxString ServerAddressNormal;
-
+ wxString ServerAddressNormal;
+
conn = curl_easy_init();
+#if defined(__APPLE__)
+
+ SetConnectionObject(conn);
+
+#endif
+
struct CardDAVCURLPasser {
CardDAV *Data;
wxString ETagOriginal;
wxString ETagServer;
- ServerAddressURL = ServerAddress + wxT(":") + wxString::Format(wxT("%i"), ServerPort) + wxT("/") + ServerPrefix + ServerFilenameLocation;
+ ServerAddressURL = ServerAddress + wxT(":") + wxString::Format(wxT("%i"), ServerPort) + ServerPrefix + ServerFilenameLocation;
ServerAddressSSL = wxT("https://") + ServerAddressURL;
ServerAddressNormal = wxT("http://") + ServerAddressURL;
}
+#if defined(__APPLE__)
+
+#else
+
ServerCertFilename = GetAccountDir(ServerAccount, TRUE);
if (wxFile::Exists(ServerCertFilename) == TRUE){
curl_easy_setopt(conn, CURLOPT_CAINFO, (const char*)ServerCertFilename.mb_str(wxConvUTF8));
}
+
+#endif
claconncode = (curl_easy_perform(conn));
// 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;
wxString SSLLocalData;
wxString SSLServerData;
-
- sslerrconncode = (curl_easy_perform(sslerrconn));
-
+
+ sslerrconncode = (curl_easy_perform(sslerrconn));
+
SSLCertCol = BuildSSLCollection(sslerrconn);
std::map<int, SSLCertData>::iterator SSLCDIter = SSLCertCol.SSLCollection.find(0);
std::multimap<wxString,wxString>::iterator SSLDataIter = SSLCDIter->second.CertData.find(wxT("Cert"));
curl_easy_cleanup(sslerrconn);
}
+
+#endif
// Sort out SSL error.
curl_easy_setopt(sslerrconn, CURLOPT_NOSIGNAL, 1);
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));
+#if defined(__APPLE__)
+
+#else
+
SSLCertCol = BuildSSLCollection(sslerrconn);
SSLCertCol.SuccessCode = 1;
+#endif
+
return;
} else if (claconncode == CURLE_HTTP_RETURNED_ERROR){
- fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ fprintf(stderr, "ProcessDataThrad(): curl_easy_perform() failed: %s\n",
curl_easy_strerror(claconncode));
int http_code = 0;
curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);