gpt4 book ai didi

ssl - 使用 Vapor 3 设置 SSL

转载 作者:太空宇宙 更新时间:2023-11-03 13:20:23 24 4
gpt4 key购买 nike

我正在使用 Vapor 3 开发服务器。我想支持 SSL。但是我找不到任何教程或文档。任何人都可以提供一些想法吗?

最佳答案

确实,在撰写本文时,Vapor 3 docs 'site:docs.vapor.codes/3.0' search did not find any information on how to setup SSL (or TLS) with Vapor 3 .

Vapor issue #359 "How to use certificate in vapor 3?"提供指导:

Vapor 3 only supports plaintext HTTP. You'll want to add something like NGINX in front for TLS. The docs from Vapor 2 should help: https://docs.vapor.codes/2.0/deploy/nginx/

FWIW, Vapor 4 will include TLS support.

对于 Vapor 3,可以通过 NGINX 等代理提供 SSL:

  1. NGINX 背后的 Proxy Vapor。参见 Vapor 2 docs "Deploying with NGINX"Vapor 4 docs "Deploying with NGINX" . “使用 NGINX 部署”页面通常与 Vapor 3 相关。

  2. 然后,按照有关使用 NGINX 设置 Let's Encrypt SSL/TLS 证书的更容易获得的教程之一进行操作。例如:

否则,尚未发布的 Vapor 4(需要 Swift 5 和 NIO 2.0)有望支持 SSL/TLS,而无需启用 SSL/TLS 的代理。

关于ssl - 使用 Vapor 3 设置 SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55897286/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com