If your application accesses a webservice or other type of service where a secure connection is required by the use of SSL, you need to make sure this SSL certificate is valid. On a development machine this is not always possible. At runtime the application will throw an exception: System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

One way to solve this, is to handle the ServerCertificateValidationCallback function yourself by always returning true. Add the following code to your application start code like global.asax.cs.

protected void Application_BeginRequest(object sender, EventArgs e)
{
   bool useUnsecureSSL = false;

   Boolean.TryParse(ConfigurationManager.AppSettings["UseUnsecureSSL"] ?? "false", out useUnsecureSSL);

   if (useUnsecureSSL)
   {
      ServicePointManager.ServerCertificateValidationCallback = delegate(object source, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
          {
             return true;
          };
   }
}

Add an appSetting called useUnsecureSSL with a value of true to allow for a nonvalid SSL certificate. By default your application requires a valid certificate as it should in a production environment.