首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >本机:启用自动TLS证书配置-不工作

本机:启用自动TLS证书配置-不工作
EN

Stack Overflow用户
提问于 2020-02-27 08:54:10
回答 1查看 397关注 0票数 1

我正在尝试“启用自动的TLS证书配置”

我有一个工作的ClusterIssuer(status:"True"),我能够手动创建一个证书(status:"True")。

我正在尝试启用自动TLS供应模式

环境设置:

代码语言:javascript
复制
Knative: v0.12
Istio: v1.4 (SDS)
cert-manager: v0.13.1

kubectl version                                                               
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.9", GitCommit:"2e808b7cb054ee242b68e62455323aa783991f03", GitTreeState:"clean", BuildDate:"2020-01-18T23:33:14Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.9-gke.9", GitCommit:"a9973cbb2722793e2ea08d20880633ca61d3e669", GitTreeState:"clean", BuildDate:"2020-02-07T22:35:02Z", GoVersion:"go1.12.12b4", Compiler:"gc", Platform:"linux/amd64"}

我有以下网关:

代码语言:javascript
复制
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: knative-ingress-gateway
  namespace: knative-serving
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
    tls:
      # Sends 301 redirect for all http requests.
      # Omit to allow http and https.
      httpsRedirect: false
  - port:
      number: 443
      name: https
      protocol: HTTPS
    hosts:
    - "mydomain.com"
    tls:
      mode: SIMPLE
      privateKey: /etc/istio/ingressgateway-certs/tls.key
      serverCertificate: /etc/istio/ingressgateway-certs/tls.crt

在申请时:

代码语言:javascript
复制
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: helloworld-go
  namespace: default
spec:
  template:
    spec:
      containers:
      - image: gcr.io/knative-samples/helloworld-go # The URL to the image of the app
        env:
        - name: TARGET
          value: "Go Sample v1"

我可以(注意: httpsRedirect: false):

代码语言:javascript
复制
curl http://helloworld-go.default.mydomain.com                                       
Hello Go Sample v1!

但是,当尝试使用https时:

代码语言:javascript
复制
curl https://helloworld-go.default.mydomain.com
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to helloworld-go.default.mydomain.com:443

还:

本机文档声明:“在这种模式下,将为每个命名空间提供单个证书,并在will中重用”,但我没有在任何命名空间中看到任何证书。

请注意,kubectl get ksvc url是http而不是https:

代码语言:javascript
复制
kubectl get ksvc
NAME            URL                                      LATESTCREATED         LATESTREADY           READY   REASON
helloworld-go   http://helloworld-go.default.mydomain.com   helloworld-go-lxr2n   helloworld-go-lxr2n   True    
EN

回答 1

Stack Overflow用户

发布于 2020-10-16 16:54:11

我也有过同样的问题。但是版本为0.16.0。我通过没有使用cert管理器的“启用自动TLS证书配置”来修正它,而是使用了直接从knative提供的HTTP-01。

如何使用加密HTTP01挑战自动提供TLS证书:

  1. 转到https://knative.dev/docs/install/any-kubernetes-cluster/#optional-serving-extensions
  2. 点击"TLS通过HTTP01“
  3. 按照指示执行
  4. 应起作用
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60429443

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档