}
-CalDAVServerResult CalDAV::Connect(){
+CalDAVServerResult CalDAV::Connect(bool doAuthentication){
+
+ connectionData.useSSL ? SetupDefaultParametersSSL(doAuthentication) : SetupDefaultParametersNonSSL(doAuthentication);
+ ResetResults();
CalDAVServerResult serverResult;
curl_easy_setopt(connectionHandle, CURLOPT_URL, serverAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_USERPWD, serverUserPass.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_FAILONERROR, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_TIMEOUT, connectionData.timeout);
curl_easy_setopt(connectionHandle, CURLOPT_WRITEFUNCTION, CalDAVReceive);
serverResult.code = curl_easy_perform(connectionHandle);
// Process the result received from the server.
-
- if (serverResult.code != CURLE_OK){
-
- serverResult.result = CALDAVQUERYRESULT_SERVERERROR;
-
- } else {
-
- serverResult.result = CALDAVQUERYRESULT_OK;
-
- }
-
+
// Get the HTTP code.
curl_easy_getinfo(connectionHandle, CURLINFO_RESPONSE_CODE, &serverResult.httpCode);
+
+ switch(serverResult.code){
+ case CURLE_OK:
+ authPassed = true;
+ case CURLE_HTTP_RETURNED_ERROR:
+ if (connectionData.useSSL)
+ {
+ sslStatus = connectionData.useSSL;
+ sslVerified = COSSL_VERIFIED;
+ }
+ serverResult.result = CALDAVQUERYRESULT_OK;
+ if (serverResult.httpCode == 401)
+ {
+ authPassed = false;
+ }
+ break;
+ case CURLE_SSL_CACERT:
+ case CURLE_SSL_CONNECT_ERROR:
+ if (connectionData.useSSL)
+ {
+ sslStatus = connectionData.useSSL;
+ sslVerified = COSSL_UNABLETOVERIFY;
+ }
+ serverResult.result = CALDAVQUERYRESULT_SSLFAILURE;
+ authPassed = false;
+ break;
+ default:
+ serverResult.result = CALDAVQUERYRESULT_SERVERERROR;
+ authPassed = false;
+ break;
+ };
+
+ if (serverResult.httpCode >= 200 && serverResult.httpCode <= 299)
+ {
+ validResponse = true;
+ }
return serverResult;
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PROPFIND");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &userPrincipalSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Reset the changed settings.
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_URL, calendarHomeURL.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PROPFIND");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &calendarHomeSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_URL, calendarListURLAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PROPFIND");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &calendarListSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_URL, entryListURLAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "REPORT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryListSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_URL, entryListURLAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "REPORT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryListSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, entryListURLAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "REPORT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &updatedEntryListSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
struct curl_slist *calendarRequestHeader = NULL;
- //curl_easy_setopt(ConnectionHandle, CURLOPT_HTTPHEADER, CalendarRequestHeader);
+ //curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, CalendarRequestHeader);
curl_easy_setopt(connectionHandle, CURLOPT_URL, calendarListURLAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "MKCALENDAR");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &calendarAddSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
struct curl_slist *calendarRequestHeader = NULL;
- //curl_easy_setopt(ConnectionHandle, CURLOPT_HTTPHEADER, CalendarRequestHeader);
+ //curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, CalendarRequestHeader);
curl_easy_setopt(connectionHandle, CURLOPT_URL, calendarEditURLAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PROPPATCH");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &calendarEditSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_URL, getETagURLAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "REPORT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryETagGetData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_URL, entryAddURLAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryAddSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_URL, entryAddURLAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryAddSendData);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_URL, originalServerAddress.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, NULL);
COSSLVerified CalDAV::SSLVerify()
{
- return SSLVerified;
+ return sslVerified;
}
-void CalDAV::BypassSSLVerification(bool EnableBypass){
- EnableSSLBypass = EnableBypass;
- SSLSelfSigned = EnableBypass;
+void CalDAV::BypassSSLVerification(bool enableBypass){
+ enableSSLBypass = enableBypass;
+ sslSelfSigned = enableBypass;
}
#if defined(__APPLE__)
SecTrustRef CalDAV::BuildSSLCollection(){
- return CertificateData;
+ return certificateData;
}
PCCERT_CONTEXT CalDAV::BuildSSLCollection(){
- return CertificateData;
+ return certificateData;
}
// Build and return the SSL collection.
- SSLCertCollectionString SSLCertInfo;
+ SSLCertCollectionString sslCertInfo;
// Grab the certificate data.
certptr.certdata = NULL;
- CURLcode result = curl_easy_getinfo(ConnectionSession, CURLINFO_CERTINFO, &certptr.certinfo);
+ CURLcode result = curl_easy_getinfo(connectionHandle, CURLINFO_CERTINFO, &certptr.certinfo);
- std::string CertPropName;
- std::string CertPropValue;
+ std::string certPropName;
+ std::string certPropValue;
for (int i = 0; i < certptr.certinfo->num_of_certs; i++){
struct curl_slist *slist;
- SSLCertDataString SSLCertDataInc;
+ SSLCertDataString sslCertDataInc;
for (slist = certptr.certinfo->certinfo[i]; slist; slist = slist->next){
// Using wxStringTokenizer from wxWidgets.
- wxStringTokenizer CertDataInc(wxString::FromUTF8(slist->data), ":");
+ wxStringTokenizer certDataInc(wxString::FromUTF8(slist->data), ":");
// Get first token as the property name.
- CertPropName = CertDataInc.GetNextToken().ToStdString();
+ certPropName = certDataInc.GetNextToken().ToStdString();
// Get remaining tokens as the property value.
- while(CertDataInc.HasMoreTokens()){
+ while(certDataInc.HasMoreTokens()){
- CertPropValue.append(CertDataInc.GetNextToken());
+ certPropValue.append(certDataInc.GetNextToken());
}
- SSLCertDataInc.CertData.insert(std::make_pair(CertPropName, CertPropValue));
- CertPropName.clear();
- CertPropValue.clear();
+ sslCertDataInc.CertData.insert(std::make_pair(certPropName, certPropValue));
+ certPropName.clear();
+ certPropValue.clear();
}
- SSLCertInfo.SSLCollection.insert(std::make_pair(i, SSLCertDataInc));
+ sslCertInfo.SSLCollection.insert(std::make_pair(i, sslCertDataInc));
}
- return SSLCertInfo;
+ return sslCertInfo;
}
#endif
+bool CalDAV::CanDoSSL(){
+ return sslStatus;
+}
+
+bool CalDAV::HasValidResponse(){
+ return validResponse;
+}
+
+bool CalDAV::AbleToLogin(){
+ return authPassed;
+}
+
+bool CalDAV::IsSelfSigned(){
+ return sslSelfSigned;
+}
+
+string CalDAV::GetErrorMessage(){
+
+ errorMessage = sessionErrorBuffer;
+ return errorMessage;
+
+}
+
static bool CalDAVObjectValidSettings(CalDAVConnectionData *connData){
// Check if the passed CalDAV Connection Data is has
}
-static string BuildServerAddress(CalDAVConnectionData *connData, string uriAddress){
+string CalDAV::BuildServerAddress(CalDAVConnectionData *connData, string uriAddress){
string serverAddress;
return serverAddress;
}
+
+void CalDAV::SetupDefaultParametersNonSSL(bool doAuthentication){
+
+ std::string serverAddress = "";
+
+ string serverAddressURL = "http://" + connectionData.hostname + ":" + to_string(connectionData.port) + "/";
+ string usernamePassword = connectionData.username + ":" + connectionData.password;
+
+ curl_easy_setopt(connectionHandle, CURLOPT_URL, serverAddressURL.c_str());
+ curl_easy_setopt(connectionHandle, CURLOPT_NOPROGRESS, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC);
+ curl_easy_setopt(connectionHandle, CURLOPT_TIMEOUT, 60);
+ curl_easy_setopt(connectionHandle, CURLOPT_FAILONERROR, true);
+ curl_easy_setopt(connectionHandle, CURLOPT_USERAGENT, XSDCAL_USERAGENT);
+ curl_easy_setopt(connectionHandle, CURLOPT_NOSIGNAL, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "GET");
+ curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, nullptr);
+ curl_easy_setopt(connectionHandle, CURLOPT_POSTFIELDS, nullptr);
+ curl_easy_setopt(connectionHandle, CURLOPT_POSTFIELDSIZE, 0L);
+
+ if (doAuthentication == true){
+ curl_easy_setopt(connectionHandle, CURLOPT_USERPWD, usernamePassword.c_str());
+ } else {
+ curl_easy_setopt(connectionHandle, CURLOPT_USERPWD, NULL);
+ }
+
+}
+
+void CalDAV::SetupDefaultParametersSSL(bool doAuthentication){
+
+ // Setup the default parameters.
+
+ string ServerAddressURL = "https://" + connectionData.hostname + ":" + to_string(connectionData.port) + "/";
+ string UsernamePassword = connectionData.username + ":" + connectionData.password;
+
+ curl_easy_setopt(connectionHandle, CURLOPT_URL, ServerAddressURL.c_str());
+ curl_easy_setopt(connectionHandle, CURLOPT_NOPROGRESS, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_CERTINFO, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC);
+ curl_easy_setopt(connectionHandle, CURLOPT_TIMEOUT, 60);
+ curl_easy_setopt(connectionHandle, CURLOPT_FAILONERROR, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_USERAGENT, XSDCAL_USERAGENT);
+ curl_easy_setopt(connectionHandle, CURLOPT_ERRORBUFFER, sessionErrorBuffer);
+ curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "GET");
+ curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, nullptr);
+ curl_easy_setopt(connectionHandle, CURLOPT_POSTFIELDS, nullptr);
+ curl_easy_setopt(connectionHandle, CURLOPT_POSTFIELDSIZE, 0L);
+
+ if (doAuthentication == true){
+ curl_easy_setopt(connectionHandle, CURLOPT_USERPWD, UsernamePassword.c_str());
+ } else {
+ curl_easy_setopt(connectionHandle, CURLOPT_USERPWD, NULL);
+ }
+
+ if (enableSSLBypass == true){
+ curl_easy_setopt(connectionHandle, CURLOPT_SSL_VERIFYHOST, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_SSL_VERIFYPEER, 0L);
+ curl_easy_setopt(connectionHandle, CURLOPT_SSL_VERIFYSTATUS, 0L);
+ } else {
+ curl_easy_setopt(connectionHandle, CURLOPT_SSL_VERIFYHOST, 2L);
+ curl_easy_setopt(connectionHandle, CURLOPT_SSL_VERIFYPEER, 1L);
+ curl_easy_setopt(connectionHandle, CURLOPT_SSL_VERIFYSTATUS, 1L);
+ }
+
+#if !defined(__APPLE__) || defined(__WIN32__)
+
+ if (connectionData.account.size() > 0){
+
+ // Check if the server certificate file exists.
+
+ string certificateFilename = GetAccountDir(connectionData.account, true);
+
+ if (wxFile::Exists(certificateFilename)){
+
+ curl_easy_setopt(connectionHandle, CURLOPT_CAINFO, certificateFilename.c_str());
+
+ }
+
+ }
+
+#endif
+
+}
+
+void CalDAV::ResetResults(){
+
+ sslStatus = false;
+ COSSLVerified SSLVerified = COSSL_NORESULT;
+ validResponse = false;
+ authPassed = false;
+ sslSelfSigned = false;
+ //taskCompleted = false;
+ errorMessage = "";
+ sessionErrorBuffer[0] = '\0';
+ //sessionResult = CURLE_OK;
+ serverData = "";
+ serverHeader = "";
+ /*if (headerList != nullptr){
+ curl_slist_free_all(headerList);
+ headerList = nullptr;
+ }*/
+
+}
\ No newline at end of file