mirror of
https://github.com/EtherDream/jsproxy
synced 2024-11-22 18:50:48 +00:00
[DEL] cert-gen script
This commit is contained in:
parent
fb6860ba91
commit
06e0fc2a80
1
gen-cert/.gitignore
vendored
1
gen-cert/.gitignore
vendored
@ -1 +0,0 @@
|
||||
dnsconf
|
@ -1,41 +0,0 @@
|
||||
HTTPS 证书申请脚本
|
||||
|
||||
# 依赖
|
||||
|
||||
安装 acme.sh:
|
||||
|
||||
```bash
|
||||
curl https://get.acme.sh | sh
|
||||
```
|
||||
|
||||
# 生成
|
||||
|
||||
在当前目录下新建 `dnsconf` 文件,格式为:
|
||||
|
||||
```text
|
||||
DOMAIN=example.com
|
||||
DNS_ID=dns_xx
|
||||
export xx_id=xxx
|
||||
export xx_key=xxxxxx
|
||||
```
|
||||
|
||||
第一个为域名,后面三个参考 https://github.com/Neilpang/acme.sh/wiki/dnsapi
|
||||
|
||||
例如 CloudFlare 的 DNS 服务:
|
||||
|
||||
```text
|
||||
DOMAIN=etherdream.com
|
||||
DNS_ID=dns_cf
|
||||
export CF_Key="123456789012345678901234567890"
|
||||
export CF_Email="user@gmail.com"
|
||||
```
|
||||
|
||||
> API Keys 可在 https://dash.cloudflare.com/ 查看。
|
||||
|
||||
执行 `./gen.sh` 开始申请,证书文件保存到 `~/server/cert/域名` 目录下。
|
||||
|
||||
重启服务生效:
|
||||
|
||||
```bash
|
||||
~/server/run.sh reload
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
ACME=~/.acme.sh/acme.sh
|
||||
|
||||
source ./dnsconf
|
||||
|
||||
mkdir -p ../cert/$DOMAIN
|
||||
|
||||
# 使用 Service Worker 的基本是高版本浏览器和操作系统,
|
||||
# 因此去除了 RSA,只用 ECC 算法。
|
||||
$ACME \
|
||||
--issue \
|
||||
--dns $DNS_ID \
|
||||
-d *.$DOMAIN \
|
||||
--keylength ec-256
|
||||
|
||||
$ACME \
|
||||
--install-cert -d *.$DOMAIN --ecc \
|
||||
--key-file ../cert/$DOMAIN/ecc.key \
|
||||
--fullchain-file ../cert/$DOMAIN/ecc.cer
|
Loading…
Reference in New Issue
Block a user