Skip to content

antony@notes:~/networking$ cat "使用-Certbot-命令列工具建立免費的-TLS-SSL-網域憑證.md"

使用 Certbot 命令列工具建立免費的 TLS/SSL 網域憑證

2024-04-22· networking

使用 Certbot 命令列工具建立免費的 TLS/SSL 網域憑證

環境 : SLES 15 SP5 事前準備 : 一個 Public 的 Domain,跟一個對外 IP

# 安裝 Certbot
$ sudo zypper -n in certbot

$ certbot --version
certbot 1.22.0

# 產生 SSL/TLS 憑證
$ sudo certbot certonly --manual -m sreantony@gmail.com -d antony520.com -d *.antony520.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.4-April-3-2024.pdf. You must agree in
order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
## 輸入 y 同意服務使用條款
(Y)es/(N)o:y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
## 輸入 y ,E-mail 自動註冊為 ACME 帳戶
(Y)es/(N)o:y
Account registered.
Requesting a certificate for antony520.com and *.antony520.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name:

_acme-challenge.antony520.com.

with the following value:

XHp6PGqSI6mY727g8XnlLyYVzbgOBVYsgT_cOtg_1AI

Before continuing, verify the TXT record has been deployed. Depending on the DNS
provider, this may take some time, from a few seconds to multiple minutes. You can
check if it has finished deploying with aid of online tools, such as the Google
Admin Toolbox: https://toolbox.googleapps.com/apps/dig/#TXT/_acme-challenge.antony520.com.
Look for one or more bolded line(s) below the line ';ANSWER'. It should show the
value(s) you've just added.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Create a file containing just this data:

4oAGvPw9KSDg4RArSZoz7bKIAiGASyweV9F09u92f4E.o3vn2SL8r66xEEAkIAQ9cLJqpbdwUl21aDsOrJ1RkOY

And make it available on your web server at this URL:

http://antony520.com/.well-known/acme-challenge/4oAGvPw9KSDg4RArSZoz7bKIAiGASyweV9F09u92f4E

(This must be set up in addition to the previous challenges; do not remove,
replace, or undo the previous challenge tasks yet.)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue

Cloudflare Tunnel

$ sudo zypper -n in podman

$ sudo podman run -d --name cloudflare-tunnel --network=host cloudflare/cloudflared:latest tunnel --no-autoupdate run --token eyJhIjoiN2IzYTVlMTUxZjQ3Mjc3NjNkZTA5OGE3Mjk3ZDQ2OTEiLCJ0IjoiNWE0MWY1YTQtZmJkZC00MDkxLThhYWQtNGMyMWNiNjJmYzMwIiwicyI6Ik5USXdaVEEyWWpVdE5UY3lZeTAwWWpSaExUbGlOelV0TjJJd1ltRTVZbVE0WVRneCJ9