Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
|SSL_CTX_SET_TLSEXT_STATUS_CB(3)||Library Functions Manual||SSL_CTX_SET_TLSEXT_STATUS_CB(3)|
OCSP Certificate Status Request functions
SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, int (*callback)(SSL *, void *)); long
SSL_CTX_get_tlsext_status_cb(SSL_CTX *ctx, int (*callback)(SSL *, void *)); long
SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg); long
SSL_CTX_get_tlsext_status_arg(SSL_CTX *ctx, void **arg); long
SSL_set_tlsext_status_type(SSL *s, int type); long
SSL_get_tlsext_status_type(SSL *s); long
SSL_get_tlsext_status_ocsp_resp(ssl, unsigned char **resp); long
SSL_set_tlsext_status_ocsp_resp(ssl, unsigned char *resp, int len);
SSL_set_tlsext_status_type() function on an individual SSL object prior to the start of the handshake. Currently the only supported type is
TLSEXT_STATUSTYPE_ocsp. This value should be passed in the type argument. The client should additionally provide a callback function to decide what to do with the returned OCSP response by calling
SSL_CTX_set_tlsext_status_cb(). The callback function should determine whether the returned OCSP response is acceptable or not. The callback will be passed as an argument the value previously set via a call to
SSL_CTX_set_tlsext_status_arg(). Note that the callback will not be called in the event of a handshake where session resumption occurs (because there are no Certificates exchanged in such a handshake). The callback previously set via
SSL_CTX_set_tlsext_status_cb() can be retrieved by calling
SSL_CTX_get_tlsext_status_cb(), and the argument by calling
SSL_CTX_get_tlsext_status_arg(). On the client side,
SSL_get_tlsext_status_type() can be used to determine whether the client has previously called
SSL_set_tlsext_status_type(). It will return
TLSEXT_STATUSTYPE_ocspif it has been called or -1 otherwise. On the server side,
SSL_get_tlsext_status_type() can be used to determine whether the client requested OCSP stapling. If the client requested it, then this function will return
TLSEXT_STATUSTYPE_ocsp, or -1 otherwise. The response returned by the server can be obtained via a call to
SSL_get_tlsext_status_ocsp_resp(). The value *resp will be updated to point to the OCSP response data and the return value will be the length of that data. If the server has not provided any response data, then *resp will be
NULLand the return value from
SSL_get_tlsext_status_ocsp_resp() will be -1. A server application must also call the
SSL_CTX_set_tlsext_status_cb() function if it wants to be able to provide clients with OCSP Certificate Status responses. Typically the server callback would obtain the server certificate that is being sent back to the client via a call to SSL_get_certificate(3), obtain the OCSP response to be sent back, and then set that response data by calling
SSL_set_tlsext_status_ocsp_resp(). A pointer to the response data should be provided in the resp argument, and the length of that data should be in the len argument.
SSL_TLSEXT_ERR_OK(meaning that the OCSP response that has been set should be returned),
SSL_TLSEXT_ERR_NOACK(meaning that an OCSP response should not be returned), or
SSL_TLSEXT_ERR_ALERT_FATAL(meaning that a fatal error has occurred).
SSL_set_tlsext_status_ocsp_resp() always return 1, indicating success.
TLSEXT_STATUSTYPE_ocspon the client side if
SSL_set_tlsext_status_type() was previously called, or on the server side if the client requested OCSP stapling. Otherwise -1 is returned.
SSL_get_tlsext_status_ocsp_resp() returns the length of the OCSP response data or -1 if there is no OCSP response data. ssl(3), SSL_CTX_callback_ctrl(3)
SSL_set_tlsext_status_ocsp_resp() first appeared in OpenSSL 0.9.8h and have been available since OpenBSD 4.5.
SSL_CTX_get_tlsext_status_arg() first appeared in OpenSSL 1.1.0 and have been available since OpenBSD 6.3.
SSL_get_tlsext_status_type() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 7.0.
|September 11, 2021||Debian|