According to https://github.com/libp2p/specs/blob/master/tls/tls.md#libp2p-public-key-extension, the given remote_public_key should be checked inside ServerCertVerifier::verify_server_cert against P2pExtension::public_key:
The public host key allows the peer to calculate the peer ID of the peer it is connecting to. Clients MUST verify that the peer ID derived from the certificate matches the peer ID they intended to connect to, and MUST abort the connection if there is a mismatch.