[英]Issue with HTTPS connection to CosmosDb Emulator in Linux Docker Container
最近宣布了一个新的 CosmosDb 模拟器 Linux 。
我正在为 Windows 使用 Docker。通过 ASP.NET 核心连接到 Linux Docker 容器中的 CosmosDb 仿真器时出现问题。
带有模拟器的 Docker 容器成功启动,我可以通过以下方式访问资源管理器: http://localhost:8081/_explorer/index.html
然后我在 Visual Studio 中运行该项目并遇到该问题
SSL连接无法建立
我已尝试从本指南安装证书,但我的主机是 Windows,它对我不起作用。
您能否建议如何在 Windows 主机上安装 Linux 容器的证书?
您必须将证书从 Docker 容器下载到您的主机并安装它 (PowerShell):
#Download certificate from container
Invoke-RestMethod -Uri https://$($ipAddress):8081/_explorer/emulator.pem -Method Get | Out-File "$($env:TEMP)/emulatorcert.crt"
#Import certificate
$cert = Import-Certificate -FilePath "$($env:TEMP)/emulatorcert.crt" -CertStoreLocation Cert:\LocalMachine\Root
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.