Jam*_*s B 5 ssl android iis-express xamarin
我正在开发我的第一个 Xamarin.Forms 应用程序,并且有一个使用 ASP.Net Core 构建的后端 API。我希望对 API 的所有调用都通过 HTTPS 进行,因此请按照本指南设置 HTTPS 以在 ASP.NET Core 中进行开发。我相信,这会让我在 Visual Studio 中使用 IIS Express 开发证书。
到目前为止,我一直在使用HttpClient以下 http uri通过模拟器从我的 Xamarin.Forms Android 应用程序对 API 进行所有调用
http://10.0.2.2:44321/api/User
Run Code Online (Sandbox Code Playgroud)
但是现在为我的 API 启用了 SSL,我需要使用以下 uri 从应用程序进行调用
https://10.0.2.2:44321/api/User
Run Code Online (Sandbox Code Playgroud)
但是,简单地更改http为https会出现以下错误
{Javax.Net.Ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. ---> Java.Security.Cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. ---> Java.Security.Cert.CertPathValidatorException: Trust anchor for certification path not found.
--- End of inner exception stack trace ---
Run Code Online (Sandbox Code Playgroud)
我认为这是因为 Xamarin.Forms 应用程序没有将 IIS 开发证书列为受信任,即,从我的 API 运行Swagger ( Swashbuckle ) 我可以毫无问题地到达端点;邮递员在SSL certificate verification关闭的情况下运行,我也可以到达终点。
如何设置 Xamarin.Forms 应用程序(特别是 Android)以信任 IIS 开发证书以用于开发目的?
| 归档时间: |
|
| 查看次数: |
334 次 |
| 最近记录: |