X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2FfrmEditAccount.cpp;h=67df523d406861f8c32fc32212b701d688f16883;hp=faea105f49e090a5ae95d09eca19dbc073100829;hb=ce6b921249b87bb62df485af240697ba81cd409d;hpb=5d754ed0c1a843766a530550ac038c534c2eeb4b diff --git a/source/frmEditAccount.cpp b/source/frmEditAccount.cpp index faea105..67df523 100644 --- a/source/frmEditAccount.cpp +++ b/source/frmEditAccount.cpp @@ -93,7 +93,47 @@ void frmEditAccount::DetectAddressBook( wxCommandEvent& event ) if (TestConnection.SSLVerify() == COSSL_UNABLETOVERIFY){ #if defined(__APPLE__) + + TestConnection.BypassSSLVerification(true); + + COConnectResult TestConnectionResult = TestConnection.Connect(false); + + TestConnection.BypassSSLVerification(false); + + int SSLResult = DisplayTrustPanel(&TestConnection); + + if (SSLResult != NSOKButton){ + + wxMessageBox(_("An error occured whilst connnecting: ") + TestConnection.GetErrorMessage(), _("Failed"), wxOK+wxICON_ERROR); + return; + + } + #elif defined(__WIN32__) + + TestConnection.BypassSSLVerification(true); + + COConnectResult TestConnectionResult = TestConnection.Connect(false); + + TestConnection.BypassSSLVerification(false); + + BOOL ModifiedCertificateData = false; + CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(&TestConnection, (HWND)this->GetHandle()); + + if (!CryptUIDlgViewCertificate(&CertificateData, &ModifiedCertificateData)) { + wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog")); + return; + } + + if (ModifiedCertificateData == false) { + wxMessageBox(_("An invalid certificate was received from the server."), _("Invalid certificate")); + return; + } else { + TestConnection.BypassSSLVerification(true); + COConnectResult TestConnectionResult = TestConnection.Connect(true); + TestConnection.BypassSSLVerification(false); + } + #else // Connect again and fetch SSL certificate information. @@ -127,8 +167,6 @@ void frmEditAccount::DetectAddressBook( wxCommandEvent& event ) TestConnection.BypassSSLVerification(true); COConnectResult TestConnectionResult = TestConnection.Connect(true); - - TestConnection.BypassSSLVerification(false); } else if (SSLResult == 2){ @@ -144,9 +182,11 @@ void frmEditAccount::DetectAddressBook( wxCommandEvent& event ) } // Get the server prefix if the connection was successful. - + if (TestConnectionResult == COCONNECT_OK){ + COConnectResult TestConnectionResult = TestConnection.Connect(true); + if (UsingSSLBypass == true){ TestConnection.BypassSSLVerification(true); } @@ -328,4 +368,4 @@ bool frmEditAccount::GetDialogResult(){ return DialogResult; -} \ No newline at end of file +}