Routing based on certificate name/alias

Hi all,

is it possible to use conditional rules/routing based on which certificate was actually used in this connection?

Let’s say I have a bunch of certificates, each certificate with more than one subjectAltName (e.g. one certificate for example.org and www.example.org, and another one for example.com and examp.le). I don’t want to repeat all these alt names in haproxy config once more in the following style:

crt-store
        load crt "example.com-key-cert.pem" ocsp-update on alias "example_com"
        load crt "example.org-key-cert.pem" ocsp-update on alias "example_org"

frontend fe
        bind *:443 ssl default_crt "@/example_com" crt "@/example_org"
        use_backend example_org if { req.ssl_sni -i "example.org" }
        use_backend example_org if { req.ssl_sni -i "www.example.org" }
        use_backend example_com if { req.ssl_sni -i "example.com" }
        use_backend example_com if { req.ssl_sni -i "examp.le" }

Is it possible to do this with only two use_backend statements which would query the certificate alias (@/...) from the crt-store section instead of every subjectAltName of all certificates?

Thanks!

-Yenya