There kind of is in recent TLS versions, supported by modern browsers and servers: SNI
I’m assuming this is what this matcher checks. However, browsers or other applications that don’t support this won’t send such packets, and thus would not be matched by this firewall matcher… So ideally you still want to deal with SNI-less packets somehow.
SNI is a server thingy.
Opening a https webpage, always a certificate with name of website FQDN is requested. (this takes place after tcp 3 way handshake at session start)
In my understanding, this tls-host thingy is just a dedicated L7 filter, targeting this certificate name in SSL handshake
It is now added to the docs… And just as I said, it’s based on the SNI value. Although an interesting caveat is that the TLS handshake the client sends needs to be within a single packet for the matcher to work. And since TLS is on a higher OSI level than TCP, sure, the idea is similar to L7 filter, except that it only checks a specific format (TLS) in the first packet, making it technically a predefined L6 filter.
I’m guessing that this matcher doesn’t work on SYN and ACK packets, but instead it inspects the first content packets. The destination and source address are as determined without this matcher. And on a match, it terminates the original connection between router and server, and creates a new one to the new destination using the new source (as determined by rules including the matcher).
To the client, nothing would appear out of the ordinary, as long as the server at the final destination has the correct certificate. The final destination server would also not notice anything different. The original destination server would notice a TCP connection that gets immediately terminated, before the first packet from the client.
rules in 6.41.1 as much as it can work. But bear in mind that you cannot combine it with
connection-state=new
for reasons stated above (the client-hello packet is sent after the TCP connection has already been established) so you can use the match to break the TCP session but not to e.g. redirect it to a dedicated WAN connection, it is too late to do that when that rule matches.