问题描述
在Windows上,对于.NET Framework类,我们可以将 sslkeyrepository
指定为* SYSTEM / * USER。在 linux
上默认情况下,.NET Core类在哪里搜索证书
, sslkeyrepository
的值是什么。 p>
On Windows, for .NET Framework classes we can specify sslkeyrepository
as *SYSTEM/*USER.On linux
where does the .NET Core classes search for the certificates
by default and what could be the values for sslkeyrepository
.
推荐答案
.Net Core
使用 OpenSSL
在Linux上,因此,您需要在容器中设置 Linux环境
,以便 OpenSSL
将提取证书。
.Net Core
uses OpenSSL
on Linux, as a result, you need to set up your Linux environment
in the container so that OpenSSL
will pick up the certificate.
您可以通过两种方式进行操作:
You can do this by two ways:
-
将证书
.crt
文件复制到update-ca-certificates
将扫描的位置可信证书-例如/ usr / local / share / ca-certificates /
oron RHEL/ etc / pki / ca-trust / source / anchors /
:
Copying the the certificate
.crt
file to a location thatupdate-ca-certificates
will scan for trusted certificates - e.g./usr/local/share/ca-certificates/
oron RHEL/etc/pki/ca-trust/source/anchors/
:
COPY myca.crt /usr/local/share/ca-certificates/
调用 update-ca-certificates
:
RUN update-ca-certificates
这篇关于.net Core在Linux平台上的哪里搜索证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!