Search code examples
c#-4.0twittertwitter-oauth

Twitter Authentication/Login for c# Failed


The remote certificate is invalid according to the validation procedure. I have given the consumerkey and consumersecret in Start.Auth.cs.


Solution

  • see the servicepointmanager.servercertificatevalidationcallback documentation

    Setting the callback overrides the default behaviour and you can yourself create a custom validation routine.

    ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => { return true; };
    

    Obviously you have to attach the callback before performing the login :-)