要检查日志,使用类似以下的命令。
- systemd:
sudo journalctl -f -u gokeyless - upstart/sysvinit:
sudo tail -f /var/log/gokeyless.log
要启用调试日志,使用类似以下的命令。
cd /etc/keyless
sudo -u keyless gokeyless --loglevel 0- 确保您的密钥服务器可从网络外部访问(tcp/2407)。
- 提供数据包捕获:
sudo tcpdump -nni <interface> -s 0 -w keyless-$(date +%s).pcap port 2407
如果您在启用调试日志的情况下运行 gokeyless,并看到如下日志:
[DEBUG] connection 162.158.57.220:37490: reading half closed by client
[DEBUG] connection 162.158.57.220:37490: server closing connection
[DEBUG] connection 162.158.57.220:37490 removed
[DEBUG] spawning new connection: 162.158.57.220:37862
[DEBUG] connection 162.158.57.220:37862: reading half closed by client
[DEBUG] connection 162.158.57.220:37862: server closing connection
[DEBUG] connection 162.158.57.220:37862 removed这些日志可能表明密钥服务器未使用适当的服务器或 .PEM 文件,客户端在证书交换后中止连接。证书必须由 Keyless CA 签名,SAN 必须包含 Keyless 服务器的主机名。以下是位于 11aa40b4a5db06d4889e48e2f.example.com 的 Keyless 服务器的有效示例(注意 Subject Alternative Name 和 Authority Key Identifier):
openssl x509 -in server.pem -noout -text -certopt no_subject,no_header,no_version,no_serial,no_signame,no_validity,no_subject,no_issuer,no_pubkey,no_sigdump,no_aux | sed -e 's/^ //'X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Server Authentication
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
DD:24:97:F1:A9:F1:4C:73:D9:1B:44:EC:A1:C3:10:E9:F0:41:98:BB
X509v3 Authority Key Identifier:
keyid:29:CE:8F:F1:9D:4C:BA:DE:55:78:D7:A6:29:E9:C5:FD:1D:9D:21:48
X509v3 Subject Alternative Name:
DNS:11aa40b4a5db06d4889e48e2f.example.com
X509v3 CRL Distribution Points:
Full Name:
URI:http://ca.cfdata.org/api/v1/crl/key_server确保服务器上安装的所有密钥和证书的权限正确。
您需要仅为这些主机提供证书,或在 Cloudflare 仪表板的 SSL/TLS 应用中更改证书的优先级。
Cloudflare 目前仅为 Cloudflare 软件包仓库 ↗中支持的分发版提供软件包。
但是,密钥服务器是开源的,因此您可以尝试构建和部署二进制文件,但在 Windows 上运行不是受支持的配置,您可能会遇到 Cloudflare 无法帮助解决的问题。
您可以为多个域名使用同一密钥服务器。
但是,如果这样做,您需要将新域名的主机名和 Zone ID 添加到 gokeyless.yaml 文件。
联系您的账户团队或 Cloudflare 支持团队。