【问题标题】:openssl giving Kubernetes Ingress Controller Fake Certificateopenssl 给 Kubernetes Ingress Controller 假证书
【发布时间】:2020-10-30 08:43:45
【问题描述】:

我已经配置了ssl证书,如果我访问https://<domain>.com,我看到我的证书配置成功但是当我尝试通过以下命令检查证书时

openssl s_client -connect <domain>.com:443 | openssl x509 -noout -subject -issuer

我收到Kubernetes Ingress Controller Fake Certificate

我的 ingres 配置是:

  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: 'true'
    nginx.ingress.kubernetes.io/from-to-www-redirect: 'true'
  name: nginx-echo
spec:
  tls:
    - hosts:
      - domain.com
      secretName: domain.com
  rules:
    - host: domain.com
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
                name: website-lorem
                port:
                    number: 80

with 命令给出相同的假证书: openssl s_client -connect &lt;domain&gt;.com:443 -servername &lt;domain&gt; | openssl x509 -noout -subject -issuer

日志:

 6 flags.go:205] Watching for Ingress class: nginx
W1029 22:02:36.331841       6 flags.go:210] Ingresses with an empty class will also be processed by this Ingress controllernginx
W1029 22:02:36.332409       6 flags.go:252] SSL certificate chain completion is disabled (--enable-ssl-chain-completion=false)
W1029 22:02:36.332525       6 client_config.go:552] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I1029 22:02:36.332855       6 main.go:231] Creating API client for https://<ip>:443
I1029 22:02:36.342532       6 main.go:275] Running in Kubernetes cluster version v1.19 (v1.19.2) - git (clean) commit f57430*** - platform linux/amd64
I1029 22:02:36.470142       6 main.go:105] SSL fake certificate created /etc/ingress-controller/ssl/default-fake-certificate.pem
I1029 22:02:36.472357       6 main.go:113] Enabling new Ingress features available since Kubernetes v1.18
W1029 22:02:36.476751       6 main.go:125] No IngressClass resource with name nginx found. Only annotation will be used.
I1029 22:02:36.485119       6 ssl.go:528] loading tls certificate from certificate path /usr/local/certificates/cert and key path /usr/local/certificates/key
I1029 22:02:36.544518       6 nginx.go:263] Starting NGINX Ingress controller

【问题讨论】:

  • 因为这个安卓系统证书无法验证:stackoverflow.com/questions/64600587/…
  • 你可以尝试添加 -servername: openssl s_client -connect &lt;domain&gt;:443 -servername &lt;domain&gt; | openssl x509 -noout -subject -issuer 看看它是否有效?
  • @thomas 仍然提供假证书

标签: ssl opengl kubernetes kubernetes-ingress


【解决方案1】:

问题是

  1. --default-ssl-certificate 未设置标志。更多详情可以找到here
  2. Intermediate certificate 未设置。详情请查看this thread

现在它的工作。

还有一个Github thread 有这个问题。

【讨论】:

  • --default-ssl-certificate和中间证书你用了什么证书?我不知道在那里使用哪些证书。对于子域,我的问题与您的问题完全相同,例如ex.example.com。它显示了一个让我们通过浏览器加密证书,但 openssl 显示了一个假的 k8s 证书......
  • @user8462556 你能解释一下这些步骤,比如你把--default-ssl-certificate标志放在哪里。
猜你喜欢
  • 2019-02-19
  • 1970-01-01
  • 1970-01-01
  • 2020-06-26
  • 2019-11-05
  • 1970-01-01
  • 1970-01-01
  • 2019-09-05
相关资源
最近更新 更多