+ // Connect again and fetch SSL certificate information.
+
+ TestConnection.BypassSSLVerification(true);
+
+ COConnectResult TestConnectionResult = TestConnection.Connect(false);
+
+ TestConnection.BypassSSLVerification(false);
+
+ SSLCertCollectionString CertData = TestConnection.BuildSSLCollection();
+ frmInvalidSSLCertificate *frmICPtr = new frmInvalidSSLCertificate(this);
+
+ frmICPtr->LoadDataNew(CertData, txtAddress->GetValue().ToStdString());
+ frmICPtr->ShowModal();
+
+ int SSLResult = frmICPtr->GetResult();
+
+ // Clean up before processing response.
+
+ delete frmICPtr;
+ frmICPtr = NULL;
+
+ // Process the response from the user.
+
+ if (SSLResult == 1){
+
+ // Accept the Certificate.
+
+ UsingSSLBypass = true;
+ TestConnection.BypassSSLVerification(true);
+
+ COConnectResult TestConnectionResult = TestConnection.Connect(true);
+
+ TestConnection.BypassSSLVerification(false);
+
+ } else if (SSLResult == 2){
+
+ // Reject the certificate, abort the task.
+
+ wxMessageBox(_("Server certficiate rejected. Unable to detect the prefix."), _("Failed"), wxOK+wxICON_ERROR);
+
+ return;
+
+ }
+
+#endif
+ }