Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fullchain.pem #298

Closed
JoyceBabu opened this issue Oct 14, 2016 · 3 comments
Closed

fullchain.pem #298

JoyceBabu opened this issue Oct 14, 2016 · 3 comments

Comments

@JoyceBabu
Copy link
Contributor

How can I generate fullchain.pem? Why isn't it generated with the other files?

@xenolf
Copy link
Member

xenolf commented Oct 14, 2016

Hello there!
The file we generate only has the intermediate and the client certificate in it which should generally be enough. What is your usecase where you need the CA cert as well?

@JoyceBabu
Copy link
Contributor Author

I did not realize that the .crt file contained the Lets Encrypt CA certificate too. Sorry.

@im7mortal
Copy link

im7mortal commented Jun 21, 2017

To generate fullchain.pem

certificates, failures := client.ObtainCertificate([]string{"example.com"}, b, nil, false)
// ...
fullchain := []byte{}
fullchain = append(fullchain, certificates.Certificate...)
fullchain = append(fullchain, certificates.IssuerCertificate...)

Then

ioutil.WriteFile("cert.pem", certificates.Certificate, 0644)
ioutil.WriteFile("chain.pem", certificates.IssuerCertificate, 0644)
ioutil.WriteFile("fullchain.pem", fullchain, 0644)
ioutil.WriteFile("privkey.pem", certificates.PrivateKey, 0640)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants