class MyHTTPSConnection(VerifiedHTTPSConnection):

    def connect(self):
        self.sock = socket.socket(socket.AF_INET)
self.sock.connect((self.host, self.port))
if self._tunnel_host:
    self._tunnel()
self.sock = ssl.wrap_socket(self.sock, self.key_file, self.cert_file)
requests.packages.urllib3.connectionpool.HTTPSConnection = MyHTTPSConnection
requests.packages.urllib3.connectionpool.VerifiedHTTPSConnection = (
    MyHTTPSConnection)
(requests.packages.urllib3.connectionpool.HTTPSConnectionPool.ConnectionCls
    ) = MyHTTPSConnection
Force requests to use IPv4 / IPv6