【发布时间】:2019-07-10 13:47:23
【问题描述】:
我们在我们的 aks 实例上安装了来自 DigiCert 的通配符证书,它适用于 IE 和 Chrome,但 Firefox 存在很大的问题,即不信任该站点。当我通过 SSL 检查器运行该站点时,它表明
The certificate is not trusted in all web browsers. You may need to install an Intermediate/chain certificate to link it to a trusted root certificate.
这些是最初安装证书所遵循的说明:
将 SSL 证书安装到每个命名空间中 从 pfx 文件中导出证书 为此,您将需要 openssl。这是我能找到的在 Windows 10 中安装和使用它的最佳资源。
openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.txt
打开 .txt 文件并删除标题(即从 -----BEGIN CERTIFICATE----- 一直到底部)
从 pfx 文件中导出私钥
openssl pkcs12 -in filename.pfx -nocerts -out key.txt
打开 .txt 文件并删除标题(即从 -----BEGIN ENCRYPTED PRIVATE KEY----- 一直到底部)
从私钥中删除密码
openssl rsa -in key.txt -out server.txt
创造秘密 通过azure的cli连接kube,然后运行命令:
az aks get-credentials -g aks-rg -n clustername
将 kube 合并到您的 kubectl cli。
如果您需要删除之前安装的证书,您应该运行以下命令:
kubectl delete secret clustername-tls --namespace dev
kubectl delete secret clustername-tls --namespace test
kubectl delete secret clustername-tls --namespace uat
kubectl delete secret clustername-tls --namespace prod
创建新证书:
kubectl create secret tls clustername-tls --key server.txt --cert cert.txt --namespace dev
kubectl create secret tls clustername-tls --key server.txt --cert cert.txt --namespace test
kubectl create secret tls clustername-tls --key server.txt --cert cert.txt --namespace uat
kubectl create secret tls clustername-tls --key server.txt --cert cert.txt --namespace prod
正确安装中间证书时遗漏了什么?
【问题讨论】:
-
这没有多大意义,它说明了您如何创建秘密,但没有说明您如何使用它们
标签: azure kubernetes azure-aks