Home

Access oData Feed with an Untrusted SSL Certificate from LinqPad

edited May 2012
I'm trying to access an oData feed I've created on Windows Azure using Visual Studio LightSwitch in VS2011 Beta. The feed uses SSL, but it's a self-signed certificate and, of course, it's untrusted. Trying to connect to the feed from LinqPad gives the error
"Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."
In my .NET code I can do something like
// save the current SSL Checking behaviour var oldCallBack = ServicePointManager.ServerCertificateValidationCallback; // Ignore SSL errors ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => { return true; }; // Do my call to the self-signed site here // reset SSL behaviour ServicePointManager.ServerCertificateValidationCallback = oldCallBack;

to wrap the calls and ignore the error.

Is there a way to get LinqPad to ignore the error?

Comments

Sign In or Register to comment.