Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tips:ssl [2017/05/26 14:47] – [certificate integration for apache] scipio | tips:ssl [2022/06/22 07:15] (current) – [letsencrypt staging] sscipioni | ||
---|---|---|---|
Line 5: | Line 5: | ||
[[https:// | [[https:// | ||
+ | ===== letsencrypt staging ===== | ||
+ | |||
+ | get ca certificate and use with curl | ||
+ | <code | download> | ||
+ | API_HOST=sso.csgalileo.org | ||
+ | echo quit | openssl s_client -showcerts -servername " | ||
+ | curl --cacert cacert.pem https:// | ||
+ | </ | ||
+ | |||
+ | in browser import this [[https:// | ||
+ | ===== certbot ====== | ||
+ | |||
+ | < | ||
+ | snap install --classic certbot | ||
+ | |||
+ | # or for focal pre | ||
+ | add-apt-repository ppa: | ||
+ | apt-get update | ||
+ | apt-get install -y certbot python-certbot-nginx | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | certbot certonly --webroot -w / | ||
+ | </ | ||
+ | |||
+ | wildcard | ||
+ | < | ||
+ | certbot certonly \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | ==== nginx ==== | ||
+ | |||
+ | < | ||
+ | server { | ||
+ | listen 80; | ||
+ | server_name nextcloud.csgalileo.org; | ||
+ | server_tokens off; | ||
+ | |||
+ | location / | ||
+ | root /var/www; | ||
+ | allow all; | ||
+ | } | ||
+ | |||
+ | location / { | ||
+ | return 301 https:// | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | server { | ||
+ | listen 443; | ||
+ | server_name nnextcloud.csgalileo.org; | ||
+ | | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | renew | ||
+ | < | ||
+ | certbot renew [--dry-run] | ||
+ | </ | ||
+ | |||
+ | automatic renew | ||
+ | < | ||
+ | systemctl status certbot.service | ||
+ | </ | ||
+ | |||
+ | / | ||
+ | < | ||
+ | max-log-backups = 0 | ||
+ | deploy-hook = systemctl reload nginx | ||
+ | </ | ||
===== acme.sh integration for letsencrypt ===== | ===== acme.sh integration for letsencrypt ===== | ||