使用Steam设置SSL

时间:2017-03-25 23:09:17

标签: swift ubuntu ssl lets-encrypt vapor

我有这样的配置

{
    "default": {
        "port": "443",
        "host": "example.com",
        "securityLayer": "tls",
        "tls": {
            "certificates": "files",
            "certificateFile": "/etc/letsencrypt/live/example.com/fullchain.pem",
            "privateKeyFile": "/etc/letsencrypt/live/example.com/privkey.pem"
        }
    }
}

drop启动时,它会打印出此控制台消息:

No TLS signature supplied, defaulting to selfSigned.

根据产生该错误消息的代码判断,配置中的signature字段应为selfSignedsignedFilesignedDirectory

enter image description here

我有来自let's encrypt的这些文件:

  • cert.pem
  • chain.pem
  • fullchain.pem
  • privkey.pem

如何解决该错误消息?

1 个答案:

答案 0 :(得分:1)

这应解决问题

{
    "default": {
        "port": "443",
        "host": "example.com",
        "securityLayer": "tls",
        "tls": {
            "signature": "signedFile",
            "certificates": "files",
            "certificateFile": "/etc/letsencrypt/live/example.com/fullchain.pem",
            "privateKeyFile": "/etc/letsencrypt/live/example.com/privkey.pem"
        }
    }
}

Vapor不建议直接在Vapor中使用SSL证书。

您应该考虑使用ngix或apache作为SSL代理:https://docs.vapor.codes/2.0/deploy/nginx/