Hi,
In order to verify client certificates in HAProxy, you need to set the “verify” option to “required”. The certificates provided by the client are to be verified using a CA listed in “ca-file”, which is a PEM file containing CA certificates.
For you to implement the nginx snippet in HAProxy, you would need to make below changes in the frontend section of haproxy.cfg:
Also, as far as i am aware, haproxy does not support limiting client ssl certificate verification depth. Therefore, ssl_verify_depth is not configured in the above haproxy configuration.
Regarding the ssl verification depth, haproxy veryfies the entire chain. You can access variables like ssl_c_ca_err_depth or ssl_c_ca_err to understand what error happen on what depth.
You can also choose to ignore certain errors with ca-ignore-err.
None of this should be necessary though, as by default haproxy verifies the full chain, which you probably expect.