gpt4 book ai didi

ssl - Kubernetes Ingress SSL 证书问题

转载 作者:太空宇宙 更新时间:2023-11-03 13:58:56 24 4
gpt4 key购买 nike

我的 TLS 有问题。我创建了我的 TLS secret :

kubectl create secret tls ingress-tls  --key certificate.key  --cert certificate.crt

我在 ingress 中使用它:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: "beta"
spec:
tls:
- hosts:
- '*.host.com'
- 'beta.host.com'
secretName: ingress-tls
backend:
serviceName: nginx
servicePort: 443

入口完美创建,我通过浏览器访问没问题,当我执行 curl 或使用程序 postman 时出现问题,我收到证书错误。

curl: (60) SSL certificate problem: unable to get local issuercertificate More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore couldnot establish a secure connection to it. To learn more about thissituation and how to fix it, please visit the web page mentionedabove.

我正在使用 GCE 驱动程序,它是来自谷歌云的默认 GKE。

我一直在阅读如何添加 ca key ,但此错误并未修复。

我做了以下事情:

kubectl create secret generic ca --from-file certificate.ca.crt

并且我在 ingress 中添加了以下注释:

ingress.kubernetes.io/auth-tls-secret: ca

但是不工作。

有谁知道如何修复 CA 证书?该证书是在 DonDominio 网站上购买的,它是一个 Wildcard。

最佳答案

问题基本上是我在生成 TLS key 时使用的是 .crt 而不是 .pem。通过更改密码,我得到 curl 以将其检测为有效证书。

新命令:

kubectl create secret tls ingress-tls --key certificate.key --cert certificate.pem 

感谢@Michael-sqlbot!

关于ssl - Kubernetes Ingress SSL 证书问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56717348/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com