Xray-core icon indicating copy to clipboard operation
Xray-core copied to clipboard

新增简单ACME支持

Open Fangliding opened this issue 1 year ago • 8 comments

走的极简主义 只需要在 tlsSettings 加入 acmeToken 选项即可启动 只支持DNSAPI 配置后不再需要手动填证书

"tlsSettings": {
    "serverName": "example.com", // 要用ACME这个必填,ACME需要知道服务器网址
    "acmeToken": "114514", // 目前只支持cloudflare api
    "acmeMail": "[email protected]" // 可选 默认 [email protected]
}

支持其他选项也不难 但是就需要添加额外的结构体了 我个人觉得使用ACME大都出于省事考虑就不想搞那么复杂

Fangliding avatar Jun 11 '24 08:06 Fangliding

这个跟用 acme.sh 有啥区别?

yuhan6665 avatar Jun 11 '24 14:06 yuhan6665

这个跟用 acme.sh 有啥区别?

emmmm 直接填token就能用 不用安装acme.sh不用填证书路径 程序会自己管理申请和续期 参考caddy那套自动TLS的机制(其实这就是caddy的库)

Fangliding avatar Jun 11 '24 14:06 Fangliding

好吧 个人不倾向加 主要是依赖有点大 证书管理本来就是 acme certbot 各有所爱的。。

yuhan6665 avatar Jun 11 '24 14:06 yuhan6665

好吧 个人不倾向加 主要是依赖有点大 证书管理本来就是 acme certbot 各有所爱的。。

acme.sh certbot 实现的都是acme标准 这个和acme.sh没什么关系 它只是刚好叫这个名字

我加这个主要是看singbox和hy2都有 写个token不用去填证书路径了不用自己装证书了挺方便的 就想着给xray弄个 大小我看了下二进制会大2MB不到 6%的样子

Fangliding avatar Jun 11 '24 16:06 Fangliding

其实有 REALITY 之后不是很想让 Xray 多管证书的事情,不过有人需要的话可以放 v1.9.0,~~主要看需要的人多不多~~

RPRX avatar Jun 12 '24 03:06 RPRX

那我发个vote看看

Fangliding avatar Jun 12 '24 03:06 Fangliding

image ~~似乎有51%的微弱优势~~

Fangliding avatar Jun 19 '24 14:06 Fangliding

In fact, after REALITY, I don’t really want Xray to take care of the certificates

This is a really weird usecase I just thought of, and I have not tried if this PR actually works for me, but standard TLS is useful between cloudflare and origin server to enable h2 back-to-origin instead of h1. (I assume h2 performs better back-to-origin all the time, but I'm not 100% sure)

Therefore it can be said, easier TLS is beneficial for users of splithttp :sweat_smile:

Of course, there are already a few other options to have "easy TLS", and for this usecase self-signed certs can be used.

mmmray avatar Jul 23 '24 16:07 mmmray

In fact, after REALITY, I don’t really want Xray to take care of the certificates

This is a really weird usecase I just thought of, and I have not tried if this PR actually works for me, but standard TLS is useful between cloudflare and origin server to enable h2 back-to-origin instead of h1. (I assume h2 performs better back-to-origin all the time, but I'm not 100% sure)

Therefore it can be said, easier TLS is beneficial for users of splithttp 😅

Of course, there are already a few other options to have "easy TLS", and for this usecase self-signed certs can be used.

仅 CDN 的话用自签证书就行了,如果还有直连用 REALITY 加 Nginx 更好,没有服务端 TLS 指纹问题,~~SH 的再 path 分流回 Xray~~

SplitHTTP H3 出来后这个 PR 更没必要了,放 Xray 在前面又没有 bbr,即使以后有 bbr 还是有服务端 TLS 指纹问题,不如反代

~~然后这个 PR 加了一大堆 dependencies 看着就可啪,close 了~~

RPRX avatar Aug 14 '24 09:08 RPRX

还有两个原因就是,如果实在需要的话,可以用 Xray 的证书自动热重载,~~如果这 ACME 合进来的话,客户端表示很需要可选编译~~

RPRX avatar Aug 14 '24 09:08 RPRX

这东西的目的就是不用装acme.sh或者certbot什么的 单一个xray直接就可以跑起来 如果只打算用cloudflare的话这套依赖确实有点多了 当时是想需要的话以后有时间可以扩展到全功能 依赖在这玩填字游戏就是了 singbox和hy2都有这些组件 当初也是看就xray没有才想着加上的 要轻的话可以用acmez手搓一个灵车出来 不过就要自己管理缓存和续签之类的问题 那就又有点麻烦了

Fangliding avatar Aug 14 '24 10:08 Fangliding

singbox和hy2都有这些组件

~~服务端 TLS 指纹表示很赞~~

RPRX avatar Aug 14 '24 10:08 RPRX

不过主要也是因为 Xray 这边的生态,TCP 主要是 REALITY,UDP 主要是 SplitHTTP H3,这俩都不需要这个 PR,而 hy2 不能被反代

RPRX avatar Aug 14 '24 10:08 RPRX

(I assume h2 performs better back-to-origin all the time, but I'm not 100% sure)

理论上 H1 基于多条 TCP 相当于多线程下载,表现应该会更好(如果 POSTs 复用了 TCP 的话,你在服务器上看一下)

RPRX avatar Aug 14 '24 11:08 RPRX

因为即使没有单 TCP 限速,H2 还是有队头阻塞,下行不小心丢一个包就全 hang 住了

RPRX avatar Aug 14 '24 11:08 RPRX