Irule Redirect with SSL profiles

I have this irule

when HTTP_REQUEST { if {[string tolower [HTTP::host]] starts_with ";}{ HTTP::redirect “https://[string range [HTTP::host] 4 end][HTTP::uri]” } }

in a VS that has two domains domain1.com and

in the Client certificate it only has domain1.com, then when I apply the irule it show me a certificate error and it does not the redirect.

¿Can someone help me?

The browser stops the user from accessing as the certificate returned by the VS is not valid for that name. It never reached the irule.

Both hostnames must be covered by one or two valid certificates.