c# - LinqToTwitter Error - The remote certificate is invalid according to the validation procedure -
i've found several different questions error, none of them seem outline scenario.
i creating website pulls in tweets our company's twitter account, , displaying them on social wall. using c# asp.net webforms. c# code uses linqtotwitter library handle authentication , "tweet pulling." grabs tweets , dumps them onto aspx file big long string of json. have jquery script reads through json , displays tweets on page nice , pretty like.
the code works perfect on dev box. when push code production .net error:
the remote certificate invalid according validation procedure
i'll provide code in bit here, first let me give little background. have no idea if information relevant or not, knows. website part of larger project fit several tiny 1 page microsites marketing onto 1 server reduce overhead cause. these microsites can have different host name, point same ip address. httpmodule lives on server, , intercepts requests coming in, , redirects them appropriate sub folder depending on host name.
from research i've done, seems ssl tied error quite bit. i'm still pretty new world, , i'm learning more ssl troubleshooting goes on. server these microsites live on have few ssl certificates on it, , 1 of microsites uses ssl, not website i'm working on. since both share same ip address in sense kind of same website.
this c# linqtotwitter code:
private singleuserauthorizer auth; private twittercontext twitterctx; protected void page_load(object sender, eventargs e) { response.contenttype = "application/json"; auth = new singleuserauthorizer { credentials = new singleuserinmemorycredentials { consumerkey = configurationmanager.appsettings["twitterconsumerkey"], consumersecret = configurationmanager.appsettings["twitterconsumersecret"], twitteraccesstoken = configurationmanager.appsettings["twitteraccesstoken"], twitteraccesstokensecret = configurationmanager.appsettings["twitteraccesstokensecret"] } }; if (auth.isauthorized) { twitterctx = new twittercontext(auth); var tweetresponse = (from tweet in twitterctx.status tweet.type == statustype.user && tweet.screenname == "ourprofile" && tweet.includeretweets == true select tweet) .tolist(); results.text = twitterctx.rawresult; } } protected override void onprerender(eventargs e) { base.onprerender(e); if (twitterctx != null) { twitterctx.dispose(); twitterctx = null; } }
does have ideas of problem here? said, i'm still pretty new, , i'm @ loss here how troubleshoot issue beyond google. our server can't verify twitter's ssl certificate trusted source? let me know if can provide more information or more code. time , reading through post!
Comments
Post a Comment