gnutls_compression_list - Linux
Overview
gnutls_compression_list
lists the available compression methods supported by the GNU Transport Layer Security (TLS) library. It is used to query the supported compression methods during TLS handshake negotiations.
Syntax
gnutls_compression_list
Options/Flags
None
Examples
Example 1: List supported compression methods
gnutls_compression_list
Output:
0: DEFLATE
2: NULL
5: ZLIB
7: ALGORITHM_ERROR
Common Issues
- Error: "gnutls_compression_list: no compression methods found"
This error occurs when no compression methods are supported by both the client and the server. Ensure that both sides have compatible compression methods enabled.
Integration
gnutls_compression_list
can be integrated into TLS handshake processes using the GnuTLS library. For example, in a TLS server application:
int ret;
gnutls_compression_method *list;
size_t list_size;
ret = gnutls_compression_list(&list, &list_size);
if (ret != GNUTLS_E_SUCCESS) {
return ret;
}
// Use the list of supported compression methods in handshake negotiations.
gnutls_compression_free(list);
Related Commands
gnutls_cipher_list
gnutls_hash_list
gnutls_session_init