kni*_*ite 7 ssl curl ssl-certificate caddy
凯迪认为一切都很好:
{"level":"info","ts":...,"logger":"tls.issuance.acme.acme_client","msg":"validations succeeded; finalizing order","order":"https://acme-v02.api.letsencrypt.org/acme/order/.../..."}
{"level":"info","ts":...,"logger":"tls.issuance.acme.acme_client","msg":"successfully downloaded available certificate chains","count":2,"first_url":"https://acme-v02.api.letsencrypt.org/acme/cert/..."}
{"level":"info","ts":...,"logger":"tls.obtain","msg":"certificate obtained successfully","identifier":"service.internal.example.com"}
{"level":"info","ts":...,"logger":"tls.obtain","msg":"releasing lock","identifier":"service.internal.example.com"}
Run Code Online (Sandbox Code Playgroud)
Caddy 容器内部:
# curl https://localhost/ -H "Host: service.internal.example.com" -v
* Trying 127.0.0.1:443...
* Connected to localhost (127.0.0.1) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS alert, internal error (592):
* error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
* Closing connection 0
curl: (35) error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
Run Code Online (Sandbox Code Playgroud)
球童文件:
{
acme_dns cloudflare ... # github.com/caddy-dns/cloudflare
}
service.internal.example.com {
reverse_proxy localhost:1234 # curl localhost:1234 works
}
Run Code Online (Sandbox Code Playgroud)
Wget 抛出相同的错误文本,但错误号略有不同:
# wget https://localhost/ --header "Host: service.internal.example.com" -v
--...-- https://localhost/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
OpenSSL: error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
Unable to establish SSL connection.
Run Code Online (Sandbox Code Playgroud)
感谢@Buffoonism,我尝试过:
$ curl https://service.internal.example.com --resolve service.internal.example.com:443:127.0.0.1
Run Code Online (Sandbox Code Playgroud)
此调用(在 Caddy 容器内)有成功的 200 响应。我已经退出到服务器并得到相同的结果:
$ curl https://service.internal.example.com --resolve service.internal.example.com:443:10.1.2.3.4 # works
Run Code Online (Sandbox Code Playgroud)
所以,这似乎是我的线索:主机头service.internal.example.com失败,但curl的解析标志有效。
我不知道接下来要尝试什么。
小智 6
它看起来像 TLS SNI 的东西。因为您连接到 localhost,curl 和 wget 将发送 TLS SNI localhost,而不是service.internal.example.com。这意味着服务器拒绝它。
作为替代方法,使用curl的resolve 选项将地址固定到域:
curl https://service.internal.example.com --resolve service.internal.example.com:443:127.0.0.1
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6899 次 |
| 最近记录: |