- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Kong API 网关上遇到了 SSL/TLS 终止问题。使用 curl 和 Insomnia 的 HTTPS 请求得到了 的响应SSL 证书问题:无法获取本地颁发者证书 .
证书有效且由知名颁发者颁发,因此 CA 证书已在客户端已知 CA 列表中。
在浏览器 HTTPS 请求中工作正常。
我正在使用 香港版 2.7.1
docker-compose.yaml 以下一种方式配置:
kong:
image: kong:2.7.1
container_name: kong-api-gw
restart: always
networks:
kong-net:
ipv4_address: 172.16.1.11
volumes:
- kong-volume:/etc/kong
- kong-volume-conf:/usr/local/kong
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_DATABASE: kong
KONG_PG_USER: ${KONG_PG_USER}
KONG_PG_PASSWORD: ${KONG_PG_PASSWORD}
KONG_PROXY_LISTEN: 0.0.0.0:8000, 0.0.0.0:8443 ssl
KONG_ADMIN_LISTEN: 0.0.0.0:8001, 0.0.0.0:8444 ssl
KONG_SSL: "on"
KONG_SSL_CERT: /etc/kong/ssl/kong.crt
KONG_SSL_CERT_KEY: /etc/kong/ssl/kong.key
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stdout
depends_on:
- kong-database
healthcheck:
test: ["CMD", "kong", "health"]
interval: 10s
timeout: 10s
retries: 10
ports:
- "8000:8000"
- "8001:8001"
- "8443:8443"
- "8444:8444"
deploy:
resources:
limits:
cpus: "2"
memory: "4000M"
logging:
driver: "json-file"
options:
max-file: "3"
max-size: "10M"
证书是使用 Admin API 和 Konga UI 添加的,我尝试了 pem 和 crt,它们都是。
curl -X POST http://127.0.0.1:8001/certificates -H 'Content-Type: multipart/form-data' -F cert=@./kong.pem -F key=@./kong.key -F snis[]=example.com
在 docker 容器中,我将 mycert.crt 和 mycert.key 放入/etc/kong/ssl/,但没有任何帮助,日志中也没有错误。
{
"data": [
{
"key_alt": null,
"created_at": 1650871124,
"cert_alt": null,
"key": "-----BEGIN RSA PRIVATE KEY-----\cert-key-example\n-----END RSA PRIVATE KEY-----",
"id": "7ebdca61-4598-4e17-bdf8-2239c41ce09b",
"tags": null,
"snis": [
"example.com"
],
"cert": "-----BEGIN CERTIFICATE-----\cert-example\n-----END CERTIFICATE-----"
}
],
"next": null
}
curl 示例
curl -i -v https://example.com:8443/api
* Trying ip:8443...
* TCP_NODELAY set
* Connected to example.com (ip) port 8443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
最佳答案
这不是错误,我想通了,Kong 需要 ca-bundle 证书而不仅仅是 crt。所以你需要结合根证书和中间证书。这些文件与您的服务器证书(专门为您的域颁发)一起完成了 SSL 信任链。最后,我只是使用 Kong Admin API 使用 Konga Web UI 或 POST 请求上传证书,例如:
curl -X POST \
http://example.com:8001/certificates \
-H 'Content-Type: multipart/form-data' \
-F cert=@./kong.ca-bundle \
-F key=@./kong.key \
-F snis[]=example.com
关于ssl - Kong API 网关 SSL/TLS 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71998636/
使用 Request Transformer插件,我们正在将查询字符串转换为多个 header 。这是针对我们所有服务在全局范围内完成的。 我们还想对服务的子集进行其他特定的转换。从我读到的here这
我使用 kong 作为 API 网关。 我正在努力调试 kong 向上游提出的请求。 我曾尝试使用 syslog插件,但它只记录 kong 收到的请求和它发送回客户端的响应。 我正在寻找调试 kong
我一直在开发微服务(Spring Cloud)一段时间(约 2 年)并大量使用 Netflix Zuul。虽然它提供了许多功能和出色的特性,但我的开发人员的想法转向了了解替代方案,并开始了解 Tyk
我正在尝试通过在无服务器方法中使用以下声明性映射来删除服务器 header : plugins: - name: response-transformer service: my-serv
我使用以下命令通过 luarocks 安装了 kong: luarocks install kong 0.14.1-0 但我找不到二进制“kong”来启动服务。文档(如下所示),bin在哪里?: 最佳
我有一个正在运行的 KONG 容器,我想向其中添加一个自定义插件,特别是 JWT crafter 。我已经下载了该插件,但我不知道如何让它从我的 KONG 容器中启动。因此,如果有人处于相同的位置或知
我正在尝试通过在无服务器方法中使用以下声明性映射来删除服务器 header : plugins: - name: response-transformer service: my-serv
我正在学习使用Kong。我将它安装在 centos 7 上。我按照 https://docs.konghq.com/install/centos/ 中的教程进行操作我坚持 kong migration
我在 Kubernetes 集群上安装了 Kong,使用 kubernetes-ingress-controller 功能( https://github.com/Kong/kubernetes-in
我是 Kong 的新手并且有一个启用了 key-auth 插件的设置。因此,当我转到 https://localhost:32443 时,我得到了 {"message":"No API key fou
今天我安装了Kong (API 管理层)在我的 Mac OS X (Yosemite 10.10.5) 上。我使用的 .pkg 文件是 available here 。我按照安装说明进行操作,一切都很
我按照教程 https://docs.konghq.com/install/docker/?_ga=2.46631079.1600317329.1601919139-2083746525.160165
有没有办法从kong的数据库中删除服务。 现在,当我再次运行实例时,我从 kong 获取了 unique constraint error。 最佳答案 您可以使用管理 API,只需使用 DELETE在
我想在 kong 中为匿名用户和经过身份验证的用户添加此端点 /graphql : 如果提供了 apikey,则视为已通过身份验证 否则视为匿名 最佳答案 尝试 key-auth 插件中的 confi
我正在为 Kong 开发自定义插件。 开始时,我遵循了本教程中列出的指南 http://streamdata.io/blog/developing-an-helloworld-kong-plugin/
我们正在寻求覆盖 Kong 错误响应结构并编写自定义消息(即用我们的自定义消息替换“超出 API 速率限制”、“无效的身份验证凭据”等)。 我们要找的错误响应结构(代码是自定义的内部错误代码,与HTT
我试图为我的公司成立Kong,所以我遵循Kong文档的指示。 首先我运行以下命令: docker network create kong-net 然后此命令: docker run -d --name
我想使用 Kong 作为我的 API 网关,在 Docker 容器中运行。每个请求都必须首先通过 NgInx 服务器,如果请求的 uri 与 example.com/api 匹配,则必须生成在 Kon
我在看 Kong替换我目前手工制作的 NodeJS API 网关。目前我有一个用户服务,它通过在登录时提供 JWT 来处理身份验证(用 Django 编写),然后客户端通过 header 传入。我当前
我们目前正在为我们的微服务分析 API 网关,而 Kong 是可能的候选者之一。我们发现 Kong 支持多个身份验证插件,但所有插件都基于存储在 Kong 数据库本身中的用户。我们需要将此责任委托(d
我是一名优秀的程序员,十分优秀!