Sli*_*nky 35 ssl-certificate curl
我需要将 .pem 证书文件添加到我的默认 CA 证书包中,但我不知道默认的 CA 证书包保存在哪里。
我需要将我的新 .pem 文件附加到这个默认包中。我宁愿这样做也不愿使用 --capath 指定我自己的位置
cURL 清楚地知道在哪里查看,但我没有看到任何显示位置的 cURL 命令。是否有命令可以显示此位置?我怎样才能找到它?
根据 cURL:
将服务器的 CA 证书添加到现有的默认 CA 证书包中。可以通过使用 --with-ca-bundle 选项运行配置来更改使用的 CA 包的默认路径,该选项指出您选择的路径。
谢谢
Flu*_*lup 42
运行curl
withstrace
可能会给你一个线索。
strace curl https://www.google.com |& grep open
很多输出,但就在接近尾声时,我看到:
打开(“/etc/ssl/certs/578d5c04.0”,O_RDONLY)= 4
这/etc/ssl/certs/
是我的证书存储的地方。
小智 20
curl 的“bin/”中应该有一个程序“curl-config”,即“curl”二进制文件所在的位置。
./curl-config --ca
给出 ca 包安装路径。
我刚刚做了一个 whatis curl-config: “获取有关 libcurl 安装的信息”,所以我想它只有在安装了 libcurl 时才可用,我认为这是标准的。
Phi*_*ego 12
-v
URL 中包含 https。
$ curl -v https://google.com
* Rebuilt URL to: https://google.com/
* timeout on name lookup is not supported
* Trying 172.217.9.174...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to google.com (172.217.9.174) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* *CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt*
Run Code Online (Sandbox Code Playgroud)
Cha*_*l P 11
我发现了一个简单的方法:用--cacert
一个错误的文件名,输出将显示的路径。
例子:
~$ curl --cacert non_existing_file https://www.google.com
curl: (77) error setting certificate verify locations:
CAfile: non_existing_file
CApath: /etc/ssl/certs
Run Code Online (Sandbox Code Playgroud)
将您的 CA 复制到目录 /usr/local/share/ca-certificates/
sudo cp foo.crt /usr/local/share/ca-certificates/foo.crt
Run Code Online (Sandbox Code Playgroud)
更新 CA 存储
sudo update-ca-certificates
Run Code Online (Sandbox Code Playgroud)
删除您的 CA 并更新 CA 存储:
sudo update-ca-certificates --fresh
Run Code Online (Sandbox Code Playgroud)
安装 ca-certificates 包:
yum install ca-certificates
Run Code Online (Sandbox Code Playgroud)
启用动态 CA 配置功能:update-ca-trust force-enable 将其作为新文件添加到/etc/pki/ca-trust/source/anchors/
:
cp foo.crt /etc/pki/ca-trust/source/anchors/
update-ca-trust extract
Run Code Online (Sandbox Code Playgroud)
将您的可信证书附加到文件中 /etc/pki/tls/certs/ca-bundle.crt
cat foo.crt >>/etc/pki/tls/certs/ca-bundle.crt
Run Code Online (Sandbox Code Playgroud)
https://manuals.gfi.com/en/kerio/connect/content/server-configuration/ssl-certificates/adding-trusted-root-certificates-to-the-server-1605.html非常好的链接,它解释了,如何将它添加到几个流行的操作系统中。
归档时间: |
|
查看次数: |
70223 次 |
最近记录: |