From 79662266e34aa7b9221a0ac2efaa0fd9d40af9fa Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Fri, 13 May 2016 14:47:56 +0100 Subject: [PATCH] Win32 Support: Implement dialog when an untrusted SSL connection is made. --- source/frmEditAccount.cpp | 17 ++++++++++++++++- source/frmEditAccount.h | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/source/frmEditAccount.cpp b/source/frmEditAccount.cpp index e9e9def..d850bf8 100644 --- a/source/frmEditAccount.cpp +++ b/source/frmEditAccount.cpp @@ -105,7 +105,22 @@ void frmEditAccount::DetectAddressBook( wxCommandEvent& event ) #if defined(__APPLE__) SSLResult = DisplayTrustPanel(&CDavObj); - + +#elif defined(__WIN32__) + + BOOL ModifiedCertificateData; + CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(&CDavObj, (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(_("Unable to get server prefix without a valid SSL certificate."), _("Error getting server prefix")); + return; + } + #else frmInvalidSSLCertificate *frmICPtr = new frmInvalidSSLCertificate(this); diff --git a/source/frmEditAccount.h b/source/frmEditAccount.h index 5c37bba..754e2c7 100644 --- a/source/frmEditAccount.h +++ b/source/frmEditAccount.h @@ -30,6 +30,10 @@ Subclass of frmEditAccountADT, which is generated by wxFormBuilder. #include "common/svrblist.h" #include "carddav/carddav.h" +#if defined(__WIN32__) +#include "common/win32ssl.h" +#endif + //// end generated include /** Implementing frmEditAccountADT */ -- 2.39.5