As discussed, we want to use common name from certificate (not alternative name). This implements the change.