'Helper method to get a certificate when it is self signed
:param url: The URL we want to query (we get the port from here)
:param domain: The domain to connect to
:return: A tuple with:
* cert
* cert_der
* cipher'

def _self_signed_cert(self, url, domain):

    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    try:
        ssl_sock = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_SSLv23)
        ssl_sock.connect((domain, url.get_port()))
    except Exception:
        msg = 'Failed    to    connect    to    %s    with    PROTOCOL_SSLv23.'
        raise RuntimeError((msg % domain))
    else:
        return self._extract_cert_data(ssl_sock)
