HAProxy 负载平衡器:无法识别对等方的证书颁发者

HAProxy load balancer: Peer's Certificate issuer is not recognized

我刚刚使用 HAProxy 1.5.2 设置了一个负载平衡器,但 HTTPS 前端无法正常工作。

我使用 curl 向我的服务器发出如下请求: 卷曲https://haproxy.example.com 输出结果如下:

curl: (60) Peer's Certificate issuer is not recognized.
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.

配置如下:

frontend https-in bind *:443 ssl crt /var/crt/mycrt.pem ca-file /var/crt/myca.crt
reqadd X-Forwarded-Proto:\ https
default_backend https-in-443

/var/crt/myca.crt 是 CA 包文件。

有人可以帮助解决这个问题吗?非常感谢。

我终于解决了这个问题

刚刚在bind *:443 ssl crt /var/crt/mycrt.pem ca-file /var/crt/myca.txt[=18= 末尾添加了 "verify optional" ]如下

参考:HAProxy: client side ssl certificates