'Extract the cert, cert_der and cipher from a ssl socket connection.
:param ssl_sock: The SSL socket connection
:return: A tuple with:
* cert
* cert_der
* cipher'

def _extract_cert_data(self, ssl_sock):

    cert = ssl_sock.getpeercert()
    cert_der = ssl_sock.getpeercert(binary_form=True)
    cipher = ssl_sock.cipher()
    ssl_sock.close()
    return (cert, cert_der, cipher)
