跳转至

导入证书

Ubuntu

sudo cp local-ca.crt /usr/local/share/ca-certificates
sudo update-ca-certificates

CentOS

sudo cp local-ca.crt /etc/pki/ca-trust/source/anchors
sudo update-ca-trust

Windows

导入根证书

Import-Certificate -FilePath 'C:\local-ca.crt' -CertStoreLocation Cert:\LocalMachine\Root

导入客户端证书

1
2
3
4
5
6
7
8
# 导入不含密码的证书
Set-Location -Path cert:\CurrentUser\My
Import-PfxCertificate -Filepath 'C:\client.p12'

# 导入含密码的证书
$pfxPassword = "PASSWORD" | ConvertTo-SecureString -AsPlainText -Force
Set-Location -Path cert:\CurrentUser\My
Import-PfxCertificate -Filepath 'C:\client.p12' -Password $pfxPassword

其他

# 查看 p12 证书的内容
openssl pkcs12 -in ~/cert.p12 -nodes -passin pass:"my password" | openssl x509 -noout -text
作者: aisuhua