簡體   English   中英

又是一個關於 Istio 證書問題的問題

[英]Again a question on Certificate issue on Istio

我的團隊我已按照鏈接為 My Istio 配置證書管理器,但我仍然無法通過 Istio 入口訪問該應用程序。

我的清單文件如下所示:

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: test-cert
  namespace: testing
spec:
  secretName: test-cert
  dnsNames:
  - "example.com"
  issuerRef:
    name: test-letsencrypt
    kind: ClusterIssuer
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: test-letsencrypt
  namespace: testing
spec:
  acme:
    email: abc@example.com
    privateKeySecretRef:
      name: testing-letsencrypt-private-key
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    solvers:
    - http01:
        ingress:
          class: istio
      selector: {}
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  annotations:
    certmanager.k8s.io/acme-challenge-type: http01
    certmanager.k8s.io/cluster-issuer: test-letsencrypt
  name: test-gateway
  namespace: testing
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 443
      name: https
      protocol: HTTPS
    hosts:
    - "example.com"
    tls:
      mode: SIMPLE
      credentialName: test-cert

誰能幫我解決我在這里缺少的東西?

來自瀏覽器的錯誤:

Secure Connection Failed

An error occurred during a connection to skydeck-test.asteria.co.in. PR_CONNECT_RESET_ERROR

    The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
    Please contact the web site owners to inform them of this problem.

Learn more…

這些日志可能會有所幫助:

  Normal   Generated  5m13s                cert-manager  Stored new private key in temporary Secret resource "test-cert-sthkc"
  Normal   Requested  5m13s                cert-manager  Created new CertificateRequest resource "test-cert-htxcr"
  Normal   Issuing    4m33s                cert-manager  The certificate has been successfully issued

samirparhi@Samirs-Mac ~ % k get certificate -n testing

NAME           READY   SECRET         AGE
test-cert   True    test-cert   19m
Note: this Namespace (testing) has Istio side car injection enabled and all the http request is working but HTTPS when I try to setup , it fails

當我的證書未經受信任的第三方身份驗證而是由我簽名時,我遇到了同樣的問題。 我必須在我的瀏覽器中添加一個例外才能訪問該站點。 所以一個簡單的金錢問題。

此外,我還能夠將我的證書添加到客戶端機器的 /etc/ssl 目錄中以毫無問題地進行連接。

此外,我還能夠通過使用 TLS 機密添加證書並將它們添加到我的虛擬服務配置中。 你也可以試試。

例子:

TLS 秘密:

kubectl create -n istio-system secret tls my-tls-secret --key=www.example.com.key --cert=www.example.com.crt

我假設您已經擁有證書及其密鑰,但如果您需要它:

證書創建:

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -subj '/O=My Company Inc./CN=example.com' -keyout example.com.key -out example.com.crt
openssl req -out www.example.com.csr -newkey rsa:2048 -nodes -keyout www.example.com.key -subj "/CN=www.example.com/O=World Wide Example organization"
openssl x509 -req -days 365 -CA example.com.crt -CAkey example.com.key -set_serial 0 -in www.example.com.csr -out www.example.com.crt

只是不要忘記以合理的方式填寫-subj字段。 據我了解,當涉及到 SSL 證書時,它們是真實性的工作因素。 例如,證書創建的第一行會為您的組織創建密鑰和證書。 未經當局批准將其添加到 Mozilla 或 Chrome 或操作系統的 ssl 數據庫中。

這就是您收到“不受信任的證書”消息的原因。 因此,出於這個原因,您可以簡單地創建一個密鑰並在受信任的第三方 dns 區域和數據庫上創建您的 dns 記錄,並通過支付他們的費用,您可以使用他們受信任的組織證書來驗證您自己的站點。

網關:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: mygateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 443
      name: https
      protocol: HTTPS
    tls:
      mode: SIMPLE
      credentialName: my-tls-secret # must be the same as secret
    hosts:
    - www.example.com

希望能幫助到你。 隨意分享“應用程序”的詳細信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM