int SSLResult;
+#if defined(__APPLE__)
+
+ SSLResult = DisplayTrustPanel(&CDavObj);
+
+#else
+
frmInvalidSSLCertificate *frmICPtr = new frmInvalidSSLCertificate(this);
frmICPtr->LoadDataNew(CDavObj.GetSSLVerifyResults(), txtAddress->GetValue());
delete frmICPtr;
frmICPtr = NULL;
-
+
+#endif
+
// Process the response from the user.
if (SSLResult == 1){
return;
}
-
} else {
bool ContinueAcc = TRUE;
wxString AccountName;
wxString AccountData;
-
+
ContinueAcc = cfgfile->GetFirstGroup(AccountName, itemindex);
-
+
while (ContinueAcc){
if (AccountName == AccName){
#include "AppXestiaAddrBk.h"
#include <wx/fileconf.h>
+#include "carddav/carddav.h"
//// end generated include
wxFileConfig *cfgfile;
wxString AccName;
bool DialogResult = false;
+#if defined(__APPLE__)
+ int DisplayTrustPanel(CardDAV *Connection);
+#endif
//// end generated class members
};
--- /dev/null
+// frmMain.mm - OS X specific functions for frmEditAccount
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+#import <Foundation/Foundation.h>
+#import <SecurityInterface/SFCertificateTrustPanel.h>
+
+#include "frmEditAccount.h"
+
+int frmEditAccount::DisplayTrustPanel(CardDAV *Connection){
+
+ NSInteger ResultValue;
+
+ SFCertificateTrustPanel *secpanel = [SFCertificateTrustPanel sharedCertificateTrustPanel];
+
+ [secpanel setDefaultButtonTitle:@"Accept"];
+ [secpanel setAlternateButtonTitle:@"Cancel"];
+ [secpanel setInformativeText: @"This certificate is not trusted. Someone could be trying to eavesdrop on your connection. Do you want to accept this certificate anyway?\n\nAccept and trusting the certificate will fetch and process information as required.\nCancel will close the connection."];
+ [secpanel setShowsHelp:YES];
+
+ [secpanel setParentWindow:(NSWindow*)this->GetHandle()];
+
+ ResultValue = [secpanel runModalForTrust:Connection->GetTrustObject() message:@"Certificate not trusted"];
+
+ return (int)ResultValue;
+
+}
\ No newline at end of file