title: The request was aborted: Could not create SSL/TLS secure
body: <p>In our web application we have social app integration (like facebook, linkedin), when we 
  try to connect facebook or linkedin from our application, its throwing error like and its not connecting to facebook, twitter and linkedin</p>
  
  <p>("System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.\\\\r\\\\n   at System.Net.HttpWebRequest.GetResponse()\\\\r\\\\n   at cotcwebmethods.FbAccesstoken_Register(Nullable`1 ID, String clientID, String AccessToken, String UserID, String UserName, String UserImage, String Email)</p>
  
  <p>but the function works for sometimes, sometime i'm getting error. </p>
  
  <p>Is it code issue or Server Issue?</p>
  
  <p>THE BELOW CODE FOR LINKEDIN</p>
  
  <p>oAuthLinkedIn _oauth = new oAuthLinkedIn();
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
    ServicePointManager.ServerCertificateValidationCallback = ValidateRemoteCertificate;</p>
  
  <p>string authLink = _oauth.AuthorizationLinkGet();</p>
  
  <p>THIS IS FOR TWITTER</p>
  
  <p>string oauth_consumer_key = System.Web.Configuration.WebConfigurationManager.AppSettings["Twikey"];
          string oauth_consumer_secret = System.Web.Configuration.WebConfigurationManager.AppSettings["TwiSecretKey"];
          HttpContext.Current.Application["Dbname"] = Convert.ToString(System.Web.HttpContext.Current.Request.Url.Host.ToString().Split('.')[0] == "localhost" ? "dbcotc_roles_permissions" : "dbcotc" + System.Web.HttpContext.Current.Request.Url.Host.ToString().Split('.')[0]);
          HttpContext.Current.Application["EmailID"] = email;
          HttpContext.Current.Application["timezone"] = timezone;
         System.Net.ServicePointManager.ServerCertificateValidationCallback = (senderX, certificate, chain, sslPolicyErrors) => { return true; };
         System.Net.ServicePointManager.ServerCertificateValidationCallback += ServerCertificate.Validate;
          try
          {
              ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
              ServicePointManager.ServerCertificateValidationCallback = ValidateRemoteCertificate;</p>
  
  <pre><code>        OAuthTokenResponse reqToken = OAuthUtility.GetRequestToken( oauth_consumer_key,oauth_consumer_secret,HttpContext.Current.Request.Url.AbsoluteUri, "");
          return string.Format("https://twitter.com/oauth/authorize?oauth_token={0}",reqToken.Token);
  
      }
  
      catch (Exception EX)
      {
          return EX.ToString();
      }
  </code></pre>