]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: ssl: add a new error codes for wrong server certificates
authorWilly Tarreau <w@1wt.eu>
Wed, 26 Jul 2017 18:09:56 +0000 (20:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 28 Jul 2017 09:50:16 +0000 (11:50 +0200)
commit71d058c288b4d108ce9352da712fd33fa5a434c7
tree6676092385623f9c4299e5021c03185fd2018bc9
parentad92a9a7be1e249234143fb0c56ed51f7a446841
MINOR: ssl: add a new error codes for wrong server certificates

If a server presents an unexpected certificate to haproxy, that is, a
certificate that doesn't match the expected name as configured in
verifyhost or as requested using SNI, we want to store that precious
information. Fortunately we have access to the connection in the
verification callback so it's possible to store an error code there.

For this purpose we use CO_ER_SSL_MISMATCH_SNI (for when the cert name
didn't match the one requested using SNI) and CO_ER_SSL_MISMATCH for
when it doesn't match verifyhost.
include/proto/connection.h
include/types/connection.h
src/ssl_sock.c