pub unsafe extern "C" fn s2n_shutdown(
conn: *mut s2n_connection,
blocked: *mut u32
) -> i32
Expand description
Attempts a closure at the TLS layer. Does not close the underlying transport. This call may block in either direction.
Unlike other TLS implementations, s2n_shutdown
attempts a graceful shutdown by default. It will not return with success unless a close_notify alert is successfully
sent and received. As a result, s2n_shutdown
may fail when interacting with a non-conformant TLS implementation.
Once s2n_shutdown
is complete:
- The s2n_connection handle cannot be used for reading for writing.
- The underlying transport can be closed. Most likely via
shutdown()
orclose()
. - The s2n_connection handle can be freed via s2n_connection_free() or reused via s2n_connection_wipe()
@param conn A pointer to the s2n_connection object
@param blocked A pointer which will be set to the blocked status if an S2N_ERR_T_BLOCKED
error is returned.
@returns S2N_SUCCESS on success. S2N_FAILURE on failure