【问题标题】:How to configure ssl for API in kong如何在kong中为API配置ssl
【发布时间】:2018-06-22 14:26:47
【问题描述】:

我正在开发 kong 0.13.1。按照文档,我添加了如下证书:

{
    "data": [
        {
            "cert": "certificate is really here", 
            "created_at": 1529667116000, 
            "id": "6ae77f49-a13f-45b1-a370-8d53b35d7bfd", 
            "key": "The key is really here", 
            "snis": [
                "myapp.local", 
                "mockbin.myapp.local"
            ]
        }
    ], 
    "total": 1
}

然后添加了一个与 http 完美配合的 API:

{
    "data": [
        {
            "created_at": 1529590900803, 
            "hosts": [
                "mockbin.myapp.local"
            ], 
            "http_if_terminated": false, 
            "https_only": false, 
            "id": "216c23c5-a1ae-4bef-870b-9c278113f8f8", 
            "name": "mockbin", 
            "preserve_host": false, 
            "retries": 5, 
            "strip_uri": true, 
            "upstream_connect_timeout": 60000, 
            "upstream_read_timeout": 60000, 
            "upstream_send_timeout": 60000, 
            "upstream_url": "http://localhost:3000"
        }
    ], 
    "total": 1
}

但不幸的是,Kong 一直向我发送位于 /usr/local/kong/ssl/kong-default.crt 的默认证书

我正在测试它:

openssl s_client -connect localhost:8443/products -host mockbin.myapp.local -debug

过去有一个动态 ssl 插件(其中 api ssl 是在 0.3.0 版本中添加的),但自 0.10 更新以来它就消失了。

我知道这可以解决我的 code 配置问题,但可能其他人也可能遇到类似问题。

【问题讨论】:

  • 你有没有解决过这个问题,我也有同样的问题。
  • @dweeb 不是,我发布了一个解决方法

标签: ssl kong


【解决方案1】:

我花了一些时间来解决它,但我没有设法解决它。正如kong docs 所说,api 已被弃用,所以我最终将所有内容都重写为路由和服务,我建议你也这样做。根据文档逐步实现,路由和服务运行良好。

【讨论】:

  • 我正在尝试使用我自己的服务使用 nginx 入口但没有运气,只是默认为 kong 证书。
【解决方案2】:

how to use the administrative api to configure ssl certificates 上的 Kong 文档似乎很清楚。在全球级别维护证书肯定比维护服务和特定路线的管理更容易。

其他寻找此问题答案的人应该会发现它很简单,按照上面链接的最新 Kong 文档中的说明进行操作。

【讨论】:

    猜你喜欢
    • 2020-03-28
    • 1970-01-01
    • 2018-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-19
    • 2010-09-18
    • 2012-12-15
    相关资源
    最近更新 更多