首页 > 解决方案 > SSL 错误:HAProxy 客户端的“不支持的证书用途”

问题描述

我正在尝试使用 HAProxy 设置客户端证书身份验证。

使用 OpenSSL,我创建了一个证书链作为(CA cert --> Intermediate cert --> Server Cert),并在使用 CA 密钥和服务器证书签署中间密钥后,我按照 ( server-cert. pem + 中级证书.pem + 根证书.pem + 服务器密钥.pem )

[root@ip-172-31-0-168 /]# cd /etc/ssl/CertChain
[root@ip-172-31-0-168 CertChain]# ls -la
total 52
drwxr-xr-x 2 root root  265 Jul 15 14:39 .
drwxr-xr-x 7 root root   86 Jul 15 13:29 ..
-rw-r--r-- 1 root root 2114 Jul 15 13:34 ca-cert.pem
-rw-r--r-- 1 root root   17 Jul 15 13:53 ca-cert.srl
-rw-r--r-- 1 root root 3268 Jul 15 13:34 ca-key.pem
-rw-r--r-- 1 root root 9374 Jul 15 14:39 haproxySSLFile.pem
-rw-r--r-- 1 root root 2000 Jul 15 13:53 Intermidate-cert.pem
-rw-r--r-- 1 root root   17 Jul 15 14:01 Intermidate-cert.srl
-rw-r--r-- 1 root root 3272 Jul 15 13:51 Intermidate-key.pem
-rw-r--r-- 1 root root 1781 Jul 15 13:51 Intermidate-req.pem
-rw-r--r-- 1 root root 1988 Jul 15 14:01 server-cert.pem
-rw-r--r-- 1 root root 3272 Jul 15 13:56 server-key.pem
-rw-r--r-- 1 root root 1769 Jul 15 13:56 server-req.pem

突出显示的文件是证书的串联版本,即我放置在 HAProxy 配置文件中的文件的位置。

一旦 Haproxy 启动并运行,我从 ssl 证书目录下载 CA-Cert.pem 文件并测试 ssl 加密,我选择邮递员(客户端)上传该 CA-Cert.pem 文件。

    bind *:80
    bind *:443 ssl crt /etc/ssl/CertChain/haproxySSLFile.pem
    redirect scheme https if !{ ssl_fc }
    mode http
    default_backend apps

通过邮递员(客户端)运行后,我得到(SSL 错误:不支持的证书目的

Certificate purposes:
SSL client : Yes
SSL client CA : No
SSL server : Yes
SSL server CA : No
Netscape SSL server : Yes
Netscape SSL server CA : No
S/MIME signing : Yes
S/MIME signing CA : No
S/MIME encryption : Yes
S/MIME encryption CA : No
CRL signing : Yes
CRL signing CA : No
Any Purpose : Yes
Any Purpose CA : Yes
OCSP helper : Yes
OCSP helper CA : No
Time Stamp signing : No
Time Stamp signing CA : No

以上是已定义的证书用途列表。我无法弄清楚我需要指定的具体目的是什么,因为我的目标是通过 SSL 为 Haproxy 加密/解密传入流量。

邮递员(客户端)错误摘要

我花了很多时间试图找出问题所在,但我没有更接近。所以我将不胜感激任何帮助!

标签: sslopensslssl-certificatehaproxyclient-certificates

解决方案


推荐阅读