ssl – golang ListenAndServeTLS的Letsencrypt证书输出

Lets’Encrypt为我提供了“签名证书”和“中级证书”.我之前必须为域创建私钥domain.key.

现在ListenAndServeTLS需要证书和密钥文件.

我猜“密钥文件”是本地生成的domain.key文件,但如果ListenAndServeTLS需要两个文件,我该如何处理“签名证书”和“中间证书”?

最佳答案 与大多数http服务器一样,Go tls服务器实现仅接受证书的单个文件.从net / http文档:

If the certificate is signed by a certificate authority, the certFile should be the concatenation of the server’s certificate, any intermediates, and the CA’s certificate.

您需要做的就是将文件连接在一起.

点赞