Sortix volatile manual
This manual documents Sortix volatile, a development build that has not been officially released. You can instead view this document in the latest official manual.
NAME
SSL_CTX_set_alpn_protos, SSL_set_alpn_protos, SSL_CTX_set_alpn_select_cb, SSL_select_next_proto, SSL_get0_alpn_selected — handle application layer protocol negotiation (ALPN)SYNOPSIS
#include <openssl/ssl.h>SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos, unsigned int protos_len);
SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos, unsigned int protos_len);
SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg), void *arg);
SSL_select_next_proto(unsigned char **out, unsigned char *outlen, const unsigned char *peer_list, unsigned int peer_list_len, const unsigned char *supported_list, unsigned int supported_list_len);
SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data, unsigned int *len);
DESCRIPTION
SSL_CTX_set_alpn_protos() and SSL_set_alpn_protos() are used by the client to set the list of protocols available to be negotiated. The protos must be in protocol-list format, described below. The length of protos is specified in protos_len.const unsigned char *vector = "\6" "spdy/1" "\8" "http/1.1"; unsigned int length = strlen(vector);
RETURN VALUES
SSL_CTX_set_alpn_protos() and SSL_set_alpn_protos() return 0 on success or non-zero on failure. WARNING: these functions reverse the return value convention.- OPENSSL_NPN_NEGOTIATED
- A match was found and is returned in out, outlen.
- OPENSSL_NPN_NO_OVERLAP
- No match was found. The first item in supported_list, supported_list_len is returned in out, outlen.
- SSL_TLSEXT_ERR_OK
- ALPN protocol selected.
- SSL_TLSEXT_ERR_ALERT_FATAL
- There was no overlap between the client's supplied list and the server configuration.
- SSL_TLSEXT_ERR_NOACK
- ALPN protocol not selected, e.g., because no ALPN protocols are configured for this connection.