'Obtain the number of secret bits of the currently used cipher.
:returns: The number of secret bits of the currently used cipher
or :py:obj:`None` if no connection has been established.
:rtype: :py:class:`int` or :py:class:`NoneType`'

def get_cipher_bits(self):

    cipher = _lib.SSL_get_current_cipher(self._ssl)
    if (cipher == _ffi.NULL):
        return None
    else:
        return _lib.SSL_CIPHER_get_bits(cipher, _ffi.NULL)
