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.
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 ...
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With