相关疑难解决方法(0)

docker container ssl证书

是否有任何优雅的方法将ssl证书添加到来自docker pull的图像?

我正在寻找一种简单且可重现的方法,将文件添加到/ etc/ssl/certs并运行update-ca-certificates.(这应该涵盖ubuntu和debian图像).

我在CoreOS上使用docker,而coreos机器信任所需的ssl证书,但docker容器显然只有默认值.

我已尝试使用docker run --entrypoint=/bin/bash然后添加证书并运行update-ca-certificates,但这似乎永久覆盖入口点.

我现在也想知道,/etc/ssl/certs从主机复制到容器上安装会更优雅吗?这样做会隐式地允许容器信任与主机相同的东西.

我正在使用令人讨厌的代理来解决所有问题:(.这会破坏SSL并使容器变得有点奇怪.

ssl ssl-certificate docker

68
推荐指数
4
解决办法
9万
查看次数

如何允许从本地主机和容器到 ASP.NET Core Web API 应用程序的 HTTPS 连接?

我正在尝试将 Docker 用于现有应用程序,但遇到以下问题。当 API 尝试从容器中获取 Identity Server 元数据时,它失败并显示以下内容:

web_api          | System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://host.docker.internal:5500/.well-known/openid-configuration'.
web_api          |  ---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'https://host.docker.internal:5500/.well-known/openid-configuration'.
web_api          |  ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
web_api          |  ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure. 
Run Code Online (Sandbox Code Playgroud)

这确实由主机浏览器确认(Chrome 中的认证错误)。

如果我使用 localhost 而不是 host.docker.internal 访问相同的元数据,它会按预期工作。

我已使用此处的说明来创建和信任身份服务器也使用的本地主机证书:

dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p { password here }
dotnet dev-certs https …
Run Code Online (Sandbox Code Playgroud)

https ssl-certificate docker asp.net-core

6
推荐指数
1
解决办法
1931
查看次数

标签 统计

docker ×2

ssl-certificate ×2

asp.net-core ×1

https ×1

ssl ×1