Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why might Windows Azure CloudBlobContainer access occasionally fail with The remote certificate is invalid according to the validation procedure

Tags:

azure

I am using an evaluation subscription to Windows Azure.

Occasionally when I try to access methods on a CloudBlobContainer such as GetPermissions() the web service hangs. After adding some logging I see "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure." in my log.

I have also had this happen when using CreateIfNotExists().

What might be causing this?

I have recently upgraded from version 1.7 to version 2 of the storage client library but still see this behavior.

like image 782
Nick Williamson Avatar asked Feb 20 '13 11:02

Nick Williamson


People also ask

How do you resolve the remote certificate is invalid according to the validation procedure?

If you get “The remote certificate is invalid according to the validation procedure” exception while trying to establish SSL connection, most likely your server certificate is self-signed or you are using incorrect host name to connect (Host name must match the name on certificate, for example imap.example.com and ...

What is the remote certificate?

Remote certificates—These remote certificates are public certificates without private keys. They can be deleted, imported, and downloaded, and their details can be viewed in the same way as local certificates.


2 Answers

This is not a problem that I've encountered before, but if the error message is accurate then there is something funky going on with the SSL certificate in storage. A possible work around is to just not use SSL. If your talking to a storage account in the same data centre, I don't think this will adversely affect security. You should be able to do this by just changing the https to http in your connection string.

If this does work, it might pay to contact MS support, it might point to a problem on their end.

like image 52
knightpfhor Avatar answered Nov 02 '22 23:11

knightpfhor


I'm going to answer my own question in the hope that it is useful to someone else.

The issue was the scope of ServicePointManager.ServerCertificateValidationCallback.

It is static and effects CloudBlobContainer methods encountered after it is set.

like image 37
Nick Williamson Avatar answered Nov 03 '22 00:11

Nick Williamson