1
私はTrelloのウェブサイトへのREST要求を行う.netコアアプリケーションを開発中です。しかし、最初のリクエストでは、TlsException: Invalid certificate received from server
が発生します。.netコアアプリケーションでウェブサイトから受け取った証明書を検証する方法
このエラーを検出した後、ServicePointManager.ServerCertificateValidationCallback
メソッドを使用した回避策が見つかりました。私の問題は、ServicePointManager
が.netコアの一部ではないということです。 Trelloの証明書を検証したり、私の環境で検証ステップを完全にバイパスする正しい方法は何でしょうか?ここで
は、関連する例外のスタックトレースです:
TlsException: Invalid certificate received from server. Error code: 0xffffffff80092012
Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates)
Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1()
Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process()
(wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process()
Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg)
Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult)
Rethrow as IOException: The authentication or decryption has failed.
Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult)
Rethrow as WebException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure
System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult)
System.Net.HttpWebRequest.GetResponse()
RestSharp.Http.GetRawResponse (System.Net.HttpWebRequest request)
Rethrow as WebException: Trello returned with an error.
Error Message: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure