Letsencrypt certificate output for golang ListenAndServeTLS

Lets'Encrypt provided me with a "Signed Certificate" and an "Intermediate Certificate." I should have created the domain.key private key for the domain before.

Now ListenAndServeTLS is expecting a certificate and key file.

I think the “keyfile” is a locally generated domain.key file, but what should I do with the “Signed Certificate” and “Intermediate Certificate” if ListenAndServeTLS expects two files?

+4
source share
1 answer

As with most HTTP servers, the Go tls server implementation accepts only one file for a certificate. From the documentation net/http:

If the certificate is signed by a certification authority, certFile must be a concatenation of the server certificate, any intermediate products, and the CA certificate.

All you have to do is merge the files together.

+2
source

All Articles