Skip to content

Instantly share code, notes, and snippets.

@rafops
Created January 24, 2017 17:11
Show Gist options
  • Save rafops/caa5d3ae300eac0839b0e21917556034 to your computer and use it in GitHub Desktop.
Save rafops/caa5d3ae300eac0839b0e21917556034 to your computer and use it in GitHub Desktop.
Let's Encrypt and CloudFront

Let's Encrypt

Install certbot:

brew install certbot

Generate certificate:

sudo certbot certonly --manual --email [email protected] -d secure.example.com

Create validation URL:

http://secure.example.com/.well-known/acme-challenge/…

Certificate will be stored in:

/etc/letsencrypt/live/secure.example.com/*

Updating certificate

AWS CloudFront

sudo aws iam upload-server-certificate --server-certificate-name secure-example-com-160906 --certificate-body file:///etc/letsencrypt/archive/secure.example.com/cert1.pem --private-key file:///etc/letsencrypt/archive/secure.example.com/privkey1.pem --certificate-chain file:///etc/letsencrypt/archive/secure.example.com/chain1.pem --path /cloudfront/ 

Edit CloudFront distribution settings and change SSL certificate to secure-example-com-160906.

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