Since Python 3.7 the hostname verification is done in
SSLSocket.do_handshake if SSLContext.check_hostname is set, so we
don't need our own code to verify the certificate.This also removes the unused _match_hostname function and its tests.
This is a backport of https://github.com/Electron-Cash/Electron-Cash/pull/2662/commits/12c0c2fe7f8a49eaed93dd2782e3c0c9a65905a9
It fixes a deprecation warning visible when running the tests with python <= 3.11, and is need to make the application run with python 3.12.
The test is adjusted to avoid failure when run disconnected from the internet.
Depends on D14439