diff -r a2a70ce3d4e8 -r 5f1cd966e0d9 applayerpluginsandutils/httptransportplugins/httptransporthandler/csecuresocketcontroller.cpp --- a/applayerpluginsandutils/httptransportplugins/httptransporthandler/csecuresocketcontroller.cpp Thu Jul 15 19:14:59 2010 +0300 +++ b/applayerpluginsandutils/httptransportplugins/httptransporthandler/csecuresocketcontroller.cpp Thu Aug 19 10:27:19 2010 +0300 @@ -16,10 +16,12 @@ // User includes #include "csecuresocketcontroller.h" #include "thttptrlayerpanic.h" +#include "chttptransportlayer.h" #include #include #include - +#include +#include CSecureSocketController* CSecureSocketController::NewL(TAny* aInitParams) /** @@ -73,17 +75,29 @@ { // Create the secure layer if( iTlsSocket == NULL ) - { - iTlsSocket = CSecureSocket::NewL(iSocket, aProtocolVersion); - } - // Get the security preferences, dialog prompt and security policy - TBool dialogPref = ETrue; + iTlsSocket = CSecureSocket::NewL(iSocket, aProtocolVersion); MSecurityPolicy* securityPolicy = NULL; - iCommsInfoProvider.SecurityPreferences(dialogPref, securityPolicy); + + TBool allowUntrustedCertificates = EFalse; - // Dialog preferences - if( !dialogPref ) - User::LeaveIfError(iTlsSocket->SetDialogMode(EDialogModeUnattended)); + allowUntrustedCertificates = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KFeatureIdFfHttpAllowUntrustedCertificates); + // Get the security preferences, dialog prompt and security policy + if( allowUntrustedCertificates ) + { + TInt dialogPref( CHttpTransportLayer::ETHttpDialogModeAttended ); + iCommsInfoProvider.SecurityPreferences(dialogPref, securityPolicy); + if ( CHttpTransportLayer::ETHttpDialogModeAllowAutomatic == dialogPref ) + { + User::LeaveIfError(iTlsSocket->SetDialogMode(EDialogModeAllowAutomatic)); + } + } + else + { + TBool dialogPref = ETrue; + iCommsInfoProvider.SecurityPreferences(dialogPref, securityPolicy); + if( !dialogPref ) + User::LeaveIfError(iTlsSocket->SetDialogMode(EDialogModeUnattended)); + } // Security policy preferences if( securityPolicy )