It seems that the CRL publishing is not the problem, at least not only this one. When I try to connect to the service HAProxy asks for the certificate and then the connection fails with google chrome error “ERR_BAD_SSL_CLIENT_AUH_CERT”
I don’t know where the error is, and what exactly produces it. If I restart the HAProxy service it works again.
Part of my config is:
global
log 127.0.0.1 local0 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
# Tune SSL
tune.ssl.default-dh-param 2048
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
retries 3
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend http_frontend
bind 10.0.0.233:80
mode http
redirect scheme https code 301 if !{ ssl_fc }
frontend https_frontend
bind 10.0.0.233:443 ssl crt /etc/haproxy/certs/xxx.pem ca-file /etc/ssl/certs/ca.pem verify required crt-ignore-err all crl-file /mnt/CRL/crl.pem
mode http
reqadd X-Forwarded-Proto:\ https
use_backend errors unless { ssl_c_verify 0 }
default_backend nc_demo_web_servers
backend errors
mode http
option http-server-close
redirect location http://xxxxx/errors/errorcertrevoked.html if { ssl_c_verify 23 }
redirect location http://xxxxx/errors/errorcertexpired.html if { ssl_c_verify 10 }
backend nc_demo_web_servers
mode http
balance leastconn
redirect scheme https if !{ ssl_fc }
stick-table type ip size 200k expire 30m
stick on src
server srv1 10.0.1.211:80 check
$ haproxy -vv
HA-Proxy version 1.6.3 2015/12/25
Copyright 2000-2015 Willy Tarreau
Build options :
TARGET = linux2628
CPU = generic
CC = gcc
CFLAGS = -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2
OPTIONS = USE_ZLIB=1 USE_REGPARM=1 USE_OPENSSL=1 USE_LUA=1 USE_PCRE=1
Default settings :
maxconn = 2000, bufsize = 16384, maxrewrite = 1024, maxpollevents = 200
Encrypted password support via crypt(3): yes
Built with zlib version : 1.2.8
Compression algorithms supported : identity("identity"), deflate("deflate"), raw-deflate("deflate"), gzip("gzip")
Built with OpenSSL version : OpenSSL 1.0.2g-fips 1 Mar 2016
Running on OpenSSL version : OpenSSL 1.0.2g 1 Mar 2016
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports prefer-server-ciphers : yes
Built with PCRE version : 8.38 2015-11-23
PCRE library supports JIT : no (USE_PCRE_JIT not set)
Built with Lua version : Lua 5.3.1
Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND
Available polling systems :
epoll : pref=300, test result OK
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 3 (3 usable), will use epoll.
This output is displayed when HAProxy is working right.
No, ca-ignore-err is not set, crt-ignore-err is set. There’s a difference.
Completely aware that the entire point here is to check CRL’s, but in troubleshooting we need to track the issue down to a specific feature and code path, to be able to do anything about that.
By the way: a CRL has a very limited lifetime, usually something like 24 hours. Are you sure haproxy is often enough reloaded with a uptodate CRL so that the CRL haproxy uses does not expire? That’s would have exactly the effect you are describing here.
In order for the error to comes up quickly I have published the CRL every 2 hours. Let me do some changes and investigation and I’ll keep you informed.
I have read in some forums that HAProxy needs to be restarted/reloaded everytime the CRL file is changed because it loads at the time it’s started and does not look for changes.
If this is the normal behavior my problem is that, I think, is it that way?
Yes, the CRL file is only read when haproxy is started. When you update the CRL file, you need to reload haproxy as well, otherwise the changes will never be applied and the CRL file will expire.