'Get the protocol that was negotiated by ALPN.'

def get_alpn_proto_negotiated(self):

    if (not _lib.Cryptography_HAS_ALPN):
        raise NotImplementedError('ALPN    not    available')
    data = _ffi.new('unsigned    char    **')
    data_len = _ffi.new('unsigned    int    *')
    _lib.SSL_get0_alpn_selected(self._ssl, data, data_len)
    if (not data_len):
        return ''
    return _ffi.buffer(data[0], data_len[0])[:]
