Skip to content

Instantly share code, notes, and snippets.

@niiicolai
Last active May 28, 2017 10:06
Show Gist options
  • Select an option

  • Save niiicolai/267d0b74e5c1b0718895ba42b57c448b to your computer and use it in GitHub Desktop.

Select an option

Save niiicolai/267d0b74e5c1b0718895ba42b57c448b to your computer and use it in GitHub Desktop.
Renew Let's encrypt certificate Heroku letsencrypt_plugin
# 1. Open a terminal.
# 2. Enter "heroku run rake letsencrypt_plugin --app <APP NAME>"
# 3. You will see the following output in the terminal.
# I, [2017-02-21T22:16:46.751310 #4] INFO -- : Trying to register at Let's Encrypt service...
# I, [2017-02-21T22:16:46.751387 #4] INFO -- : Loading private key...
# I, [2017-02-21T22:16:47.071975 #4] INFO -- : Acme::Client::Error::Malformed - Registration key is already in use
# I, [2017-02-21T22:16:47.072063 #4] INFO -- : Already registered.
# I, [2017-02-21T22:16:47.072101 #4] INFO -- : Sending authorization request for: example.com...
# I, [2017-02-21T22:16:47.211549 #4] INFO -- : Storing challenge information...
# I, [2017-02-21T22:16:49.389319 #4] INFO -- : Waiting for challenge status...
# I, [2017-02-21T22:16:50.693818 #4] INFO -- : Creating CSR...
# I, [2017-02-21T22:16:51.110951 #4] INFO -- : You are running this script on Heroku, please copy-paste certificates to your local machine
# I, [2017-02-21T22:16:51.111027 #4] INFO -- : and then follow https://devcenter.heroku.com/articles/ssl-endpoint guide:
# I, [2017-02-21T22:16:51.111118 #4] INFO -- : ====== example.com-cert.pem ======
# -----BEGIN CERTIFICATE-----
# -----END CERTIFICATE-----
# I, [2017-02-21T22:16:51.111278 #4] INFO -- : ====== example.com-key.pem ======
# -----BEGIN RSA PRIVATE KEY-----
# -----END RSA PRIVATE KEY-----
# I, [2017-02-21T22:16:51.111423 #4] INFO -- : ====== example.com-chain.pem ======
# -----BEGIN CERTIFICATE-----
# -----END CERTIFICATE-----
# I, [2017-02-21T22:16:51.111581 #4] INFO -- : ====== example.com-fullchain.pem ======
# -----BEGIN CERTIFICATE-----
# -----END CERTIFICATE-----
# -----BEGIN CERTIFICATE-----
# -----END CERTIFICATE-----
# I, [2017-02-21T22:16:51.111787 #4] INFO -- : Certificate has been generated.
# 4. Copy-paste each certificate to a folder on your local machine.
# 5. cd into the root directory of your application.
# 6. Run the following "heroku certs:update PATH/example.com-fullchain.pem PATH/example.com-key.pem --app <HEROKU APP NAME>"
# 7. You will see the following output in the terminal.
# Resolving trust chain... done
# ▸ Potentially Destructive Action
# ▸ This command will change the certificate of endpoint (herokussl.com) from ⬢ heroku-app-name.
# ▸ To proceed, type heroku-app-name or re-run this command with --confirm heroku-app-name
# 8. type "heroku-app-name"
# 9. You are done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment