Something on the network answers when a client dials a server address. It hands over a certificate. The handshake completes — real crypto, real session key, green padlock. The lock icon can't tell you who you're actually talking to. Only checking whether someone you already trust signed that certificate can.
What actually gets computed when the handshake runs:
CERT_NONE, check_hostname=False)