我的 .net6/C# 客戶端 webapp 部署到 azure app 服務,該服務正在呼叫 API(托管在 Azure VM 上)錯誤資訊 :
The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception) at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions) at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm) at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request
請注意,如果我從本地系統運行客戶端 Web 應用程式,我能夠成功呼叫 API。
僅 azure AppService 到 Azure API 呼叫會發生此例外錯誤。我的客戶端 webapp 以及 API 是我們公司內部的。用于 API 的 SSL 證書僅由我的組織頒發。
我獲得了用于 API 的相同 PFX 證書并上傳到 AppService pfx 證書部分。但我仍然收到相同的錯誤訊息。
由于證書鏈中的錯誤,遠程證書無效:UntrustedRoot
除了將 pfx 上傳到 Azure 應用服務的證書部分之外,我是否需要做任何其他事情。
任何有用的指向正確檔案的指標來幫助我解決這個錯誤?
有人遇到過這種情況嗎?有什么想法嗎 ?pfx 證書不是來自任何公共證書頒發機構。這是真正的問題嗎?
uj5u.com熱心網友回復:
您需要將組織的公鑰(屬于簽署證書的私鑰)放在 VM 的受信任根證書存盤中。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/517908.html
上一篇:為什么“https://revoked.badssl.com/”和“https://pinning-test.badssl.com/”使用Python請求回傳200回應?
