Fix SNI hostname matching

Where sub.domain1.com was available along with sub2.domain.com there
was a possibility to give bad SNI certificate for sub2.domain.com