Skip to content

Commit

Permalink
Merge pull request #62 from AsrOneSdk/sriramvu-dev
Browse files Browse the repository at this point in the history
ignoreCertificateHandler to make OneBox setup work (to be reverted befor...
  • Loading branch information
sriramvu committed Mar 12, 2015
2 parents 9b80394 + 56ea528 commit 90d2924
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using Microsoft.WindowsAzure.Management.RecoveryServices.Models;
using Microsoft.WindowsAzure.Management.SiteRecovery;
using Microsoft.WindowsAzure.Management.SiteRecovery.Models;
using System.Net.Security;

namespace Microsoft.Azure.Commands.RecoveryServices
{
Expand Down Expand Up @@ -86,11 +87,28 @@ public RecoveryServicesManagementClient GetRecoveryServicesClient
/// <param name="azureSubscription">Azure Subscription</param>
public PSRecoveryServicesClient(AzureProfile azureProfile, AzureSubscription azureSubscription)
{
if (ServicePointManager.ServerCertificateValidationCallback == null)
{
ServicePointManager.ServerCertificateValidationCallback =
IgnoreCertificateErrorHandler;

}

this.Profile = azureProfile;
this.recoveryServicesClient =
AzureSession.ClientFactory.CreateClient<RecoveryServicesManagementClient>(azureProfile, azureSubscription, AzureEnvironment.Endpoint.ServiceManagement);
}

private static bool IgnoreCertificateErrorHandler
(object sender,
System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Security.Cryptography.X509Certificates.X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
return true;

}

/// <summary>
/// Retrieves Azure Cloud services.
/// </summary>
Expand Down

0 comments on commit 90d2924

Please sign in to comment.