Function s2n_quic_tls::ffi::s2n_connection_get_selected_cert

source ·
pub unsafe extern "C" fn s2n_connection_get_selected_cert(
    conn: *mut s2n_connection
) -> *mut s2n_cert_chain_and_key
Expand description

Get the certificate used during the TLS handshake

  • If conn is a server connection, the certificate selected will depend on the ServerName sent by the client and supported ciphers.
  • If conn is a client connection, the certificate sent in response to a CertificateRequest message is returned. Currently s2n-tls supports loading only one certificate in client mode. Note that not all TLS endpoints will request a certificate.

@param conn A pointer to the s2n_connection object

@returns NULL if the certificate selection phase of the handshake has not completed or if a certificate was not requested by the peer