def METHOD_NAME(self):
    def create_sock():
        sock = socket.create_connection((self.host, self.port), self.timeout)
        if getattr(self, "_tunnel_host", None):
            self.sock = sock
            self._tunnel()
        return sock
    success = False
    # Reference(s): https://docs.python.org/2/library/ssl.html#ssl.SSLContext
    #               https://www.mnot.net/blog/2014/12/27/python_2_and_tls_sni
    if hasattr(ssl, "SSLContext"):
        for protocol in (_ for _ in _protocols if _ >= ssl.PROTOCOL_TLSv1):
            try:
                sock = create_sock()
                if protocol not in _contexts:
                    _contexts[protocol] = ssl.SSLContext(protocol)
                    # Disable certificate and hostname validation enabled by default with PROTOCOL_TLS_CLIENT
                    _contexts[protocol].check_hostname = False
                    _contexts[protocol].verify_mode = ssl.CERT_NONE
                    if getattr(self, "cert_file", None) and getattr(self, "key_file", None):
                        _contexts[protocol].load_cert_chain(certfile=self.cert_file, keyfile=self.key_file)
                    try:
                        # Reference(s): https://askubuntu.com/a/1263098
                        #               https://askubuntu.com/a/1250807
                        _contexts[protocol].set_ciphers("DEFAULT@SECLEVEL=1")
                    except ssl.SSLError:
                        pass
                result = _contexts[protocol].wrap_socket(sock, do_handshake_on_connect=True, server_hostname=self.host if re.search(r"\A[\d.]+\Z", self.host or "") is None else None)
                if result:
                    success = True
                    self.sock = result
                    _protocols.remove(protocol)
                    _protocols.insert(0, protocol)
                    break
                else:
                    sock.close()
            except (ssl.SSLError, socket.error, _http_client.BadStatusLine) as ex:
                self._tunnel_host = None
                logger.debug("SSL connection error occurred for '%s' ('%s')" % (_lut[protocol], getSafeExString(ex)))
    elif hasattr(ssl, "wrap_socket"):
        for protocol in _protocols:
            try:
                sock = create_sock()
                _ = ssl.wrap_socket(sock, keyfile=getattr(self, "key_file"), certfile=getattr(self, "cert_file"), ssl_version=protocol)
                if _:
                    success = True
                    self.sock = _
                    _protocols.remove(protocol)
                    _protocols.insert(0, protocol)
                    break
                else:
                    sock.close()
            except (ssl.SSLError, socket.error, _http_client.BadStatusLine) as ex:
                self._tunnel_host = None
                logger.debug("SSL connection error occurred for '%s' ('%s')" % (_lut[protocol], getSafeExString(ex)))
    if not success:
        errMsg = "can't establish SSL connection"
        # Reference: https://docs.python.org/2/library/ssl.html
        if LooseVersion(PYVERSION) < LooseVersion("2.7.9"):
            errMsg += " (please retry with Python >= 2.7.9)"
        if kb.sslSuccess and not self.retrying:
            self.retrying = True
            for _ in xrange(conf.retries):
                try:
                    self.METHOD_NAME()
                except SqlmapConnectionException:
                    pass
                else:
                    return
        raise SqlmapConnectionException(errMsg)
    else:
        kb.sslSuccess = True