Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
CardDAV2: Fixed issue with displaying SSL certificate
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 15 Feb 2017 01:52:57 +0000 (01:52 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 15 Feb 2017 01:52:57 +0000 (01:52 +0000)
source/carddav2/carddav2.cpp
source/frmMain.cpp
source/frmNewAccount-CardDAV2.cpp
source/frmSSLCertificate.cpp

index 1fba140..f4041b8 100644 (file)
@@ -156,6 +156,8 @@ SSLCertCollectionString CardDAV2::BuildSSLCollection(){
 
        // Build and return the SSL collection.
        
+       cout << "Build SSL Collection!" << endl;
+       
        SSLCertCollectionString SSLCertInfo;
 
        // Grab the certificate data.
@@ -167,13 +169,15 @@ SSLCertCollectionString CardDAV2::BuildSSLCollection(){
 
        certptr.certdata = NULL;
        
-       curl_easy_getinfo(ConnectionSession, CURLINFO_CERTINFO, &certptr.certinfo);
+       CURLcode result = curl_easy_getinfo(ConnectionSession, CURLINFO_CERTINFO, &certptr.certinfo);
 
+       cout << certptr.certinfo->num_of_certs << endl;
+       
        std::string CertPropName;
        std::string CertPropValue;
-
+       
        for (int i = 0; i < certptr.certinfo->num_of_certs; i++){
-
+               
                struct curl_slist *slist;
                SSLCertDataString SSLCertDataInc;
                
@@ -231,7 +235,7 @@ COConnectResult CardDAV2::Connect(bool DoAuthentication){
        
        COConnectResult ConnectResult = COCONNECT_UNITTESTFAIL;
        string ServerAddressURL = BuildURL("/principals/");
-
+       
        curl_easy_setopt(ConnectionSession, CURLOPT_URL, ServerAddressURL.c_str());
        
        if (TestMode == true){
@@ -1453,6 +1457,7 @@ void CardDAV2::SetupDefaultParametersSSL(bool DoAuthentication){
        
        curl_easy_setopt(ConnectionSession, CURLOPT_URL, ServerAddressURL.c_str());
        curl_easy_setopt(ConnectionSession, CURLOPT_NOPROGRESS, 1L);
+       curl_easy_setopt(ConnectionSession, CURLOPT_CERTINFO, 1L);
        curl_easy_setopt(ConnectionSession, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC);
        curl_easy_setopt(ConnectionSession, CURLOPT_TIMEOUT, 60);
        curl_easy_setopt(ConnectionSession, CURLOPT_FAILONERROR, 0L);
@@ -1461,9 +1466,6 @@ void CardDAV2::SetupDefaultParametersSSL(bool DoAuthentication){
        curl_easy_setopt(ConnectionSession, CURLOPT_WRITEDATA, &PageDataObject);
        curl_easy_setopt(ConnectionSession, CURLOPT_WRITEHEADER, &PageHeaderObject);
        curl_easy_setopt(ConnectionSession, CURLOPT_ERRORBUFFER, SessionErrorBuffer);
-       //curl_easy_setopt(ConnectionSession, CURLOPT_NOSIGNAL, 1L);
-       curl_easy_setopt(ConnectionSession, CURLOPT_CERTINFO, 1L);
-       //curl_easy_setopt(ConnectionSession, CURLOPT_VERBOSE, 2L);
        curl_easy_setopt(ConnectionSession, CURLOPT_CUSTOMREQUEST, "GET");
        curl_easy_setopt(ConnectionSession, CURLOPT_HTTPHEADER, nullptr);
        curl_easy_setopt(ConnectionSession, CURLOPT_POSTFIELDS, nullptr);
@@ -1509,7 +1511,7 @@ string CardDAV2::BuildURL(string URI){
        
        string ServerAddressURL;
        
-       if (SSLStatus == true){
+       if (ServerSSL == true){
                ServerAddressURL = "https://" + ServerAddress + ":" + to_string(ServerPort) + URI;      
        } else {
                ServerAddressURL = "http://" + ServerAddress + ":" + to_string(ServerPort) + URI;
index ffa99d2..3d54720 100644 (file)
@@ -2713,7 +2713,7 @@ void frmMain::ShowSSLCertificates( wxCommandEvent &event ){
                        SSLColIter = AccountSSLData.find(i);
             
                        SSLCertCollectionString SSLCertInfo = SSLColIter->second;
-            
+                       
                        frmSSLCertificate *frameSSLCert = new frmSSLCertificate ( this );
                        frameSSLCert->StartCertFrom(0);
                        frameSSLCert->SetupCertsString(SSLCertInfo);
index 3798bbf..d0b18ec 100644 (file)
@@ -37,7 +37,7 @@ void frmNewAccount::RunCardDAV2Test( wxCommandEvent& event ){
                wxAtoi(txtServerPort->GetValue()),
                txtUsername->GetValue().ToStdString(),
                txtPassword->GetValue().ToStdString(),
-               chkUseSSL->GetValue());
+               chkUseSSL->GetValue() ? true : false);
        
        // Test the connection.
        
index fee0b59..a06c9fd 100644 (file)
@@ -300,7 +300,7 @@ std::map<wxString,wxString> frmSSLCertificate::GetSubjectData(wxString SubjectDa
        // Get the subject data and put into a map<wxString,wxString>
        
        std::map<wxString,wxString> SubjectDataFinal;
-       wxStringTokenizer SubjectDataToken(SubjectData, wxT(";"));
+       wxStringTokenizer SubjectDataToken(SubjectData, wxT(","));
        wxString StringData;
        wxString SettingName;
        wxString SettingValue;
@@ -343,7 +343,7 @@ std::map<string,string> frmSSLCertificate::GetSubjectData(std::string SubjectDat
        // Get the subject data and put into a map<wxString,wxString>
        
        std::map<string,string> SubjectDataFinal;
-       wxStringTokenizer SubjectDataToken(wxString(SubjectData.c_str(), wxConvUTF8), wxT(";"));
+       wxStringTokenizer SubjectDataToken(wxString(SubjectData.c_str(), wxConvUTF8), wxT(","));
        wxString StringData;
        wxString SettingName;
        wxString SettingValue;
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