作用:
实现 https://ip
不用域名,只需要ip,即可实现https访问服务器。
申请方法-Docker版本:
# 首次申请 (run)
docker run --rm -it \
-v ~/lego:/.lego \
-p 80:8888 \
goacme/lego \
--email="[email protected]" \
--accept-tos \
--server="https://acme-v02.api.letsencrypt.org/directory" \
--http \
--http.port=":8888" \
--key-type="rsa2048" \
--domains="123.123.123.123" \
--disable-cn \
run --profile "shortlived"
# 续期申请 (renew) - 设置了提前 2 天续期并复用私钥
docker run --rm \
-v "$HOME/.lego":/.lego \
-p 80:8888 \
goacme/lego \
--email="[email protected]" \
--path="/.lego" \
--server="https://acme-v02.api.letsencrypt.org/directory" \
--http --http.port=":8888" \
--domains="123.123.123.123" \
renew --profile "shortlived" --days 2 --reuse-key
申请方法-脚本版本:
# 首次申请 (run)
./lego --email="[email protected]" \
--accept-tos \
--path="/root/.lego" \
--server="https://acme-v02.api.letsencrypt.org/directory" \
--http --http.port=":80" \
--key-type="rsa2048" \
--domains="123.123.123.123" \
run --profile "shortlived"
# 续期申请 (renew) - 脚本中设置了提前 2 天续期并复用私钥
./lego --email="[email protected]" \
--path="/root/.lego" \
--server="https://acme-v02.api.letsencrypt.org/directory" \
--http --http.port=":80" \
--domains="123.123.123.123" \
renew --profile "shortlived" --days 2 --reuse-key
软件地址:https://github.com/go-acme/lego/releases
使用方法:
替换IP为服务器公网IP即可。(需要80端口)
昨天 我偶然看见了 Let’s Encrypt 在7月发的文章【引用1】,才知道IP证书免费签发已经支持了。
然后我在网上转了一圈,相关资料非常稀少,如果是过去我觉得,不止于此吧。(个人感觉这事和AI脱不开干系)
然后,我用谷歌gemini,写了几个申请方案,我只能说,AI也是垃圾。
最后,用英语关键词,查了一下,在1Panel的议题区【引用2】,找到了正确写法。
昨天看有一篇文章,说Caddy好像也支持IP证书签发,但是我在一台网卡IP非公网IP(是独立公网)的设备上尝试,没成功,懂的大佬可以补充一下。
关于acme.sh详细教程(今天搜一下 居然有了 而且是同一天的 ):
https://www.appinn.com/letsencrypt-issue-ip-ssl-certificates/
引用1:
https://letsencrypt.org/2025/07/01/issuing-our-first-ip-address-certificate
引用2:
https://github.com/1Panel-dev/1Panel/issues/9888
转载烧饼blog的教程:
使用 acme.sh 配置 Let's Encrypt 签发的 IP 地址 SSL 证书
acme.sh 自己用的指令:
IPv4/v6 证书申请:
更新证书,都直接打这个:
@vkse #0 AI论代码的话,你换claude试试
好
@cnmdnews #2
gemini代码能力也不算差了,这事的问题,是AI现在幻觉和乱说。
我尝试了AI给我的5个版本,全错。而且其中3个都是臆想的配置。
真人写博客,大多数情况,都是别人验证后的产物,版本没太大更新,一般都能用。

AI给的,如果数据量不够多不够准的情况,就只能说,不如不用了。(稍微小众一点的东西,AI几乎都在乱说,claude\chatgpt\gemini都跑不掉。)
上面代码我也用AI处理过,但是前提是,要投喂正确的资料。(对于处理这类事情,AI的确非常好用。)
@vkse #4 nonono,只能说差远了,用过才知道,gemini和GPT给我的就是一坨屎,虽然claude也不完美,但至少它给你小土堆,而不是屎
唯一缺点是pro用量给得太少了
有acme的教程吗
@lehuoyisheng #7
~/.acme.sh/acme.sh --upgrade
~/.acme.sh/acme.sh --issue --standalone --cert-profile shortlived -d "$MAIN_IP" --keylength 2048 --server letsencrypt --force
注意改变量内容。申请时要使用本地80端口。只有5天半有效期。
@GJ33BBUu #8 支持ipv6了吗
续期也是这个命令吗?请教