Twitterを使用してログインしようとすると、最近このエラーが発生し始めました-何か考えはありますか?
Stack Trace:
[AuthenticationException: The remote certificate is invalid according to the validation procedure.]
System.Net.TlsStream.EndWrite(IAsyncResult asyncResult) +230
System.Net.PooledStream.EndWrite(IAsyncResult asyncResult) +13
System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar) +123
[WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.]
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +6432446
System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) +64
オープンソースの力のおかげで、Twitter証明書のサムプリントがKatana Projectでコーディングされていることがわかります。
Microsoft.Owin.Security.Twitter.TwitterAuthenticationOptions
最近、一部の証明書が変更されている必要があり、サムプリントが一致しなくなりました。
「VeriSign Class 3 Public Primary Certification Authority-G5」証明書の新しい拇印をStartup.Auth.cs
(MVCユーザーの)のTwitter認証オプションに追加してください。
デフォルトから変更:
app.UseTwitterAuthentication(
consumerKey: "XXXX",
consumerSecret: "XXX"
);
これを使って:
app.UseTwitterAuthentication(new TwitterAuthenticationOptions
{
ConsumerKey = "XXXX",
ConsumerSecret = "XXXX",
BackchannelCertificateValidator = new CertificateSubjectKeyIdentifierValidator(new[]
{
"A5EF0B11CEC04103A34A659048B21CE0572D7D47", // VeriSign Class 3 Secure Server CA - G2
"0D445C165344C1827E1D20AB25F40163D8BE79A5", // VeriSign Class 3 Secure Server CA - G3
"7FD365A7C2DDECBBF03009F34339FA02AF333133", // VeriSign Class 3 Public Primary Certification Authority - G5
"39A55D933676616E73A761DFA16A7E59CDE66FAD", // Symantec Class 3 Secure Server CA - G4
"5168FF90AF0207753CCCD9656462A212B859723B", //DigiCert SHA2 High Assurance Server CA
"B13EC36903F8BF4701D498261A0802EF63642BC3" //DigiCert High Assurance EV Root CA
})
});
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加