【问题标题】:How to add a certificate to Kong. To make https requests如何将证书添加到 Kong。发出 https 请求
【发布时间】:2019-05-02 11:41:29
【问题描述】:

我正在尝试使用此文档 kong docs 添加证书

但我无法弄清楚如何生成这些“证书”和“密钥”pem 文件。

我尝试使用 puttygen 生成的公钥和私钥,但没有锻炼。

样本将非常有帮助

{
"message": "3 schema violations (cert: invalid certificate: x509.cert.new: asn1_lib.c:101:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long; key: invalid key: pkey.new: tasn_dec.c:1130:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag; tags: expected a set)",
"name": "schema violation",
"fields": {
    "tags": "expected a set",
    "cert": "invalid certificate: x509.cert.new: asn1_lib.c:101:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long",
    "key": "invalid key: pkey.new: tasn_dec.c:1130:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag"
},
"code": 2
}

这是我收到的错误

【问题讨论】:

  • 证书和私钥是PEM格式的吗?
  • 遇到同样的错误,有什么进展吗?

标签: ssl certificate x509 kong


【解决方案1】:

试试这个命令


    curl -i -X 'POST' http://localhost:8001/certificates \
    -F 'cert= Content PEM archive ' \
    -F 'key=  Content key archive without password ' \
    -F 'snis=subdomain.mydomain.com'

【讨论】:

    【解决方案2】:

    我不能说我完全理解它,但是在查看了其他人在网上所做的事情之后,我可以通过在两个文件中保存相同的数据然后运行一行来打印文件中的数据来让它工作,就像这样:

    curl -i -m 60 -X POST http://localhost:8001/certificates 
    -F "cert=$(cat cert.pem)" 
    -F "key=$(cat key.pem)" 
    -F "snis=domain.net"
    

    信用: https://discuss.konghq.com/t/adding-certificate-does-not-create-sni/2497

    【讨论】:

      猜你喜欢
      • 2016-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-06
      • 2015-08-27
      相关资源
      最近更新 更多