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?


  • Thanks for your feedback. I've added a checkbox to disable certificate checking for the next build, which should be released late this week or early next.
  • Thanks Joe - rock'n'.
  • This is now in beta:
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!