mbedtls_ssl_context
ssl.h
const mbedtls_ssl_config * const mbedtls_ssl_config* mbedtls_ssl_context::private_conf private_conf mbedtls_ssl_context::private_conf

configuration information

int int mbedtls_ssl_context::private_state private_state mbedtls_ssl_context::private_state

SSL handshake: current state

int int mbedtls_ssl_context::private_renego_status private_renego_status mbedtls_ssl_context::private_renego_status

Initial, in progress, pending?

int int mbedtls_ssl_context::private_renego_records_seen private_renego_records_seen mbedtls_ssl_context::private_renego_records_seen

Records since renego request, or with DTLS, number of retransmissions of request if renego_max_records is < 0

mbedtls_ssl_protocol_version mbedtls_ssl_protocol_version mbedtls_ssl_context::private_tls_version private_tls_version mbedtls_ssl_context::private_tls_version

Maximum TLS version to be negotiated, then negotiated TLS version.

It is initialized as the configured maximum TLS version to be negotiated by mbedtls_ssl_setup().

When renegotiating or resuming a session, it is overwritten in the ClientHello writing preparation stage with the previously negotiated TLS version.

On client side, it is updated to the TLS version selected by the server for the handshake when the ServerHello is received.

On server side, it is updated to the TLS version the server selects for the handshake when the ClientHello is received.

unsigned unsigned mbedtls_ssl_context::private_badmac_seen_or_in_hsfraglen private_badmac_seen_or_in_hsfraglen mbedtls_ssl_context::private_badmac_seen_or_in_hsfraglen

Multipurpose field.

- DTLS: records with a bad MAC received.

- TLS: accumulated length of handshake fragments (up to `in_hslen`).

This field is multipurpose in order to preserve the ABI in the Mbed TLS 3.6 LTS branch. Until 3.6.2, it was only used in DTLS and called `badmac_seen`.

int(* int(* mbedtls_ssl_context::private_f_vrfy) (void *, mbedtls_x509_crt *, int, uint32_t *) )(void *, mbedtls_x509_crt *, int, uint32_t *) private_f_vrfy mbedtls_ssl_context::private_f_vrfy

Callback to customize X.509 certificate chain verification

void * void* mbedtls_ssl_context::private_p_vrfy private_p_vrfy mbedtls_ssl_context::private_p_vrfy

context for X.509 verify callback

mbedtls_ssl_send_t * mbedtls_ssl_send_t* mbedtls_ssl_context::private_f_send private_f_send mbedtls_ssl_context::private_f_send

Callback for network send

mbedtls_ssl_recv_t * mbedtls_ssl_recv_t* mbedtls_ssl_context::private_f_recv private_f_recv mbedtls_ssl_context::private_f_recv

Callback for network receive

mbedtls_ssl_recv_timeout_t * mbedtls_ssl_recv_timeout_t* mbedtls_ssl_context::private_f_recv_timeout private_f_recv_timeout mbedtls_ssl_context::private_f_recv_timeout

Callback for network receive with timeout

void * void* mbedtls_ssl_context::private_p_bio private_p_bio mbedtls_ssl_context::private_p_bio

context for I/O operations

mbedtls_ssl_session * mbedtls_ssl_session* mbedtls_ssl_context::private_session_in private_session_in mbedtls_ssl_context::private_session_in

current session data (in)

mbedtls_ssl_session * mbedtls_ssl_session* mbedtls_ssl_context::private_session_out private_session_out mbedtls_ssl_context::private_session_out

current session data (out)

mbedtls_ssl_session * mbedtls_ssl_session* mbedtls_ssl_context::private_session private_session mbedtls_ssl_context::private_session

negotiated session data

mbedtls_ssl_session * mbedtls_ssl_session* mbedtls_ssl_context::private_session_negotiate private_session_negotiate mbedtls_ssl_context::private_session_negotiate

session data in negotiation

mbedtls_ssl_handshake_params * mbedtls_ssl_handshake_params* mbedtls_ssl_context::private_handshake private_handshake mbedtls_ssl_context::private_handshake

params required only during the handshake process

mbedtls_ssl_transform * mbedtls_ssl_transform* mbedtls_ssl_context::private_transform_in private_transform_in mbedtls_ssl_context::private_transform_in

current transform params (in) This is always a reference, never an owning pointer.

mbedtls_ssl_transform * mbedtls_ssl_transform* mbedtls_ssl_context::private_transform_out private_transform_out mbedtls_ssl_context::private_transform_out

current transform params (out) This is always a reference, never an owning pointer.

mbedtls_ssl_transform * mbedtls_ssl_transform* mbedtls_ssl_context::private_transform private_transform mbedtls_ssl_context::private_transform

negotiated transform params This pointer owns the transform it references.

mbedtls_ssl_transform * mbedtls_ssl_transform* mbedtls_ssl_context::private_transform_negotiate private_transform_negotiate mbedtls_ssl_context::private_transform_negotiate

transform params in negotiation This pointer owns the transform it references.

mbedtls_ssl_transform * mbedtls_ssl_transform* mbedtls_ssl_context::private_transform_application private_transform_application mbedtls_ssl_context::private_transform_application

The application data transform in TLS 1.3. This pointer owns the transform it references.

void * void* mbedtls_ssl_context::private_p_timer private_p_timer mbedtls_ssl_context::private_p_timer

context for the timer callbacks

mbedtls_ssl_set_timer_t * mbedtls_ssl_set_timer_t* mbedtls_ssl_context::private_f_set_timer private_f_set_timer mbedtls_ssl_context::private_f_set_timer

set timer callback

mbedtls_ssl_get_timer_t * mbedtls_ssl_get_timer_t* mbedtls_ssl_context::private_f_get_timer private_f_get_timer mbedtls_ssl_context::private_f_get_timer

get timer callback

unsigned char * unsigned char* mbedtls_ssl_context::private_in_buf private_in_buf mbedtls_ssl_context::private_in_buf

input buffer

unsigned char * unsigned char* mbedtls_ssl_context::private_in_ctr private_in_ctr mbedtls_ssl_context::private_in_ctr

64-bit incoming message counter TLS: maintained by us DTLS: read from peer

unsigned char * unsigned char* mbedtls_ssl_context::private_in_hdr private_in_hdr mbedtls_ssl_context::private_in_hdr

start of record header

unsigned char * unsigned char* mbedtls_ssl_context::private_in_cid private_in_cid mbedtls_ssl_context::private_in_cid

The start of the CID; (the end is marked by in_len).

unsigned char * unsigned char* mbedtls_ssl_context::private_in_len private_in_len mbedtls_ssl_context::private_in_len

two-bytes message length field

unsigned char * unsigned char* mbedtls_ssl_context::private_in_iv private_in_iv mbedtls_ssl_context::private_in_iv

ivlen-byte IV

unsigned char * unsigned char* mbedtls_ssl_context::private_in_msg private_in_msg mbedtls_ssl_context::private_in_msg

message contents (in_iv+ivlen)

unsigned char * unsigned char* mbedtls_ssl_context::private_in_offt private_in_offt mbedtls_ssl_context::private_in_offt

read offset in application data

int int mbedtls_ssl_context::private_in_msgtype private_in_msgtype mbedtls_ssl_context::private_in_msgtype

record header: message type

size_t size_t mbedtls_ssl_context::private_in_msglen private_in_msglen mbedtls_ssl_context::private_in_msglen

record header: message length

size_t size_t mbedtls_ssl_context::private_in_left private_in_left mbedtls_ssl_context::private_in_left

amount of data read so far

uint16_t uint16_t mbedtls_ssl_context::private_in_epoch private_in_epoch mbedtls_ssl_context::private_in_epoch

DTLS epoch for incoming records

size_t size_t mbedtls_ssl_context::private_next_record_offset private_next_record_offset mbedtls_ssl_context::private_next_record_offset

offset of the next record in datagram (equal to in_left if none)

uint64_t uint64_t mbedtls_ssl_context::private_in_window_top private_in_window_top mbedtls_ssl_context::private_in_window_top

last validated record seq_num

uint64_t uint64_t mbedtls_ssl_context::private_in_window private_in_window mbedtls_ssl_context::private_in_window

bitmask for replay detection

size_t size_t mbedtls_ssl_context::private_in_hslen private_in_hslen mbedtls_ssl_context::private_in_hslen

current handshake message length, including the handshake header

int int mbedtls_ssl_context::private_nb_zero private_nb_zero mbedtls_ssl_context::private_nb_zero

# of 0-length encrypted messages

int int mbedtls_ssl_context::private_keep_current_message private_keep_current_message mbedtls_ssl_context::private_keep_current_message

drop or reuse current message on next call to record layer?

unsigned char unsigned char mbedtls_ssl_context::private_send_alert private_send_alert mbedtls_ssl_context::private_send_alert

Determines if a fatal alert should be sent. Values:

- `0` , no alert is to be sent.

- `1` , alert is to be sent.

unsigned char unsigned char mbedtls_ssl_context::private_alert_type private_alert_type mbedtls_ssl_context::private_alert_type

Type of alert if send_alert != 0

int int mbedtls_ssl_context::private_alert_reason private_alert_reason mbedtls_ssl_context::private_alert_reason

The error code to be returned to the user once the fatal alert has been sent.

uint8_t uint8_t mbedtls_ssl_context::private_disable_datagram_packing private_disable_datagram_packing mbedtls_ssl_context::private_disable_datagram_packing

Disable packing multiple records within a single datagram.

unsigned char * unsigned char* mbedtls_ssl_context::private_out_buf private_out_buf mbedtls_ssl_context::private_out_buf

output buffer

unsigned char * unsigned char* mbedtls_ssl_context::private_out_ctr private_out_ctr mbedtls_ssl_context::private_out_ctr

64-bit outgoing message counter

unsigned char * unsigned char* mbedtls_ssl_context::private_out_hdr private_out_hdr mbedtls_ssl_context::private_out_hdr

start of record header

unsigned char * unsigned char* mbedtls_ssl_context::private_out_cid private_out_cid mbedtls_ssl_context::private_out_cid

The start of the CID; (the end is marked by in_len).

unsigned char * unsigned char* mbedtls_ssl_context::private_out_len private_out_len mbedtls_ssl_context::private_out_len

two-bytes message length field

unsigned char * unsigned char* mbedtls_ssl_context::private_out_iv private_out_iv mbedtls_ssl_context::private_out_iv

ivlen-byte IV

unsigned char * unsigned char* mbedtls_ssl_context::private_out_msg private_out_msg mbedtls_ssl_context::private_out_msg

message contents (out_iv+ivlen)

int int mbedtls_ssl_context::private_out_msgtype private_out_msgtype mbedtls_ssl_context::private_out_msgtype

record header: message type

size_t size_t mbedtls_ssl_context::private_out_msglen private_out_msglen mbedtls_ssl_context::private_out_msglen

record header: message length

size_t size_t mbedtls_ssl_context::private_out_left private_out_left mbedtls_ssl_context::private_out_left

amount of data not yet written

unsigned char unsigned char mbedtls_ssl_context::private_cur_out_ctr[MBEDTLS_SSL_SEQUENCE_NUMBER_LEN] [MBEDTLS_SSL_SEQUENCE_NUMBER_LEN] private_cur_out_ctr mbedtls_ssl_context::private_cur_out_ctr

Outgoing record sequence number.

uint16_t uint16_t mbedtls_ssl_context::private_mtu private_mtu mbedtls_ssl_context::private_mtu

path mtu, used to fragment outgoing messages

char * char* mbedtls_ssl_context::private_hostname private_hostname mbedtls_ssl_context::private_hostname

Expected peer CN for verification.

Also used on clients for SNI, and for TLS 1.3 session resumption using tickets.

The value of this field can be:

- `NULL` in a newly initialized or reset context.

- A heap-allocated copy of the last value passed to mbedtls_ssl_set_hostname(), if the last call had a non-null `hostname` argument.

- A special value to indicate that mbedtls_ssl_set_hostname() was called with `NULL` (as opposed to never having been called). See `mbedtls_ssl_get_hostname_pointer()` in `ssl_tls.c`.

If this field contains the value `NULL` and the configuration option #MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME is unset, on a TLS client, attempting to verify a server certificate results in the error MBEDTLS_ERR_SSL_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME.

If this field contains the special value described above, or if the value is `NULL` and the configuration option #MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME is set, then the peer name verification is skipped, which may be insecure, especially on a client. Furthermore, on a client, the server_name extension is not sent, and the server name is ignored in TLS 1.3 session resumption using tickets.

const char * const char* mbedtls_ssl_context::private_alpn_chosen private_alpn_chosen mbedtls_ssl_context::private_alpn_chosen

negotiated protocol

mbedtls_dtls_srtp_info mbedtls_dtls_srtp_info mbedtls_ssl_context::private_dtls_srtp_info private_dtls_srtp_info mbedtls_ssl_context::private_dtls_srtp_info
unsigned char * unsigned char* mbedtls_ssl_context::private_cli_id private_cli_id mbedtls_ssl_context::private_cli_id

transport-level ID of the client

size_t size_t mbedtls_ssl_context::private_cli_id_len private_cli_id_len mbedtls_ssl_context::private_cli_id_len

length of cli_id

int int mbedtls_ssl_context::private_secure_renegotiation private_secure_renegotiation mbedtls_ssl_context::private_secure_renegotiation

does peer support legacy or secure renegotiation

size_t size_t mbedtls_ssl_context::private_verify_data_len private_verify_data_len mbedtls_ssl_context::private_verify_data_len

length of verify data stored

char char mbedtls_ssl_context::private_own_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN] [MBEDTLS_SSL_VERIFY_DATA_MAX_LEN] private_own_verify_data mbedtls_ssl_context::private_own_verify_data

previous handshake verify data

char char mbedtls_ssl_context::private_peer_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN] [MBEDTLS_SSL_VERIFY_DATA_MAX_LEN] private_peer_verify_data mbedtls_ssl_context::private_peer_verify_data

previous handshake verify data

unsigned char unsigned char mbedtls_ssl_context::private_own_cid[MBEDTLS_SSL_CID_IN_LEN_MAX] [MBEDTLS_SSL_CID_IN_LEN_MAX] private_own_cid mbedtls_ssl_context::private_own_cid

The next incoming CID, chosen by the user and applying to all subsequent handshakes. This may be different from the CID currently used in case the user has re-configured the CID after an initial handshake.

uint8_t uint8_t mbedtls_ssl_context::private_own_cid_len private_own_cid_len mbedtls_ssl_context::private_own_cid_len

The length of `own_cid`.

uint8_t uint8_t mbedtls_ssl_context::private_negotiate_cid private_negotiate_cid mbedtls_ssl_context::private_negotiate_cid

This indicates whether the CID extension should be negotiated in the next handshake or not. Possible values are MBEDTLS_SSL_CID_ENABLED and MBEDTLS_SSL_CID_DISABLED.

mbedtls_ssl_export_keys_t * mbedtls_ssl_export_keys_t* mbedtls_ssl_context::private_f_export_keys private_f_export_keys mbedtls_ssl_context::private_f_export_keys

Callback to export key block and master secret

void * void* mbedtls_ssl_context::private_p_export_keys private_p_export_keys mbedtls_ssl_context::private_p_export_keys

context for key export callback

mbedtls_ssl_user_data_t mbedtls_ssl_user_data_t mbedtls_ssl_context::private_user_data private_user_data mbedtls_ssl_context::private_user_data

User data pointer or handle.

The library sets this to `0` when creating a context and does not access it afterwards.

Serializing and restoring an SSL context with mbedtls_ssl_context_save() and mbedtls_ssl_context_load() does not currently restore the user data.

mbedtls_asn1_buf
mbedtls_asn1_named_data
oid
val
next
mbedtls_asn1_sequence
buf
next
mbedtls_dtls_srtp_info_t
mbedtls_mpi
mbedtls_pk_context
mbedtls_ssl_config
private_cert_profile
private_ca_chain
private_dn_hints
private_ca_crl
private_dhm_G
private_dhm_P
private_user_data
private_f_cert_cb
mbedtls_ssl_context
private_conf
private_session
private_session_in
private_session_negotiate
private_session_out
private_dtls_srtp_info
private_user_data
mbedtls_ssl_session
private_peer_cert
private_app_secrets
mbedtls_ssl_tls13_application_secrets
mbedtls_ssl_user_data_t
mbedtls_x509_authority
authorityCertSerialNumber
keyIdentifier
raw
authorityCertIssuer
mbedtls_x509_crl
crl_ext
issuer_raw
private_sig
private_sig_oid2
raw
sig_oid
tbs
issuer
next_update
this_update
entry
next
mbedtls_x509_crl_entry
entry_ext
raw
serial
revocation_date
next
mbedtls_x509_crt
issuer_id
issuer_raw
pk_raw
private_sig
raw
serial
sig_oid
subject_id
subject_key_id
subject_raw
...
issuer
subject
valid_from
valid_to
pk
certificate_policies
ext_key_usage
subject_alt_names
authority_key_id
next
mbedtls_x509_crt_profile
mbedtls_x509_time
- mbedtls_ssl_context
  private_alert_reason
- mbedtls_ssl_context
  private_alert_type
- mbedtls_ssl_context
  private_alpn_chosen
- mbedtls_ssl_context
  private_badmac_seen_or_in_hsfraglen
- mbedtls_ssl_context
  private_cli_id
- mbedtls_ssl_context
  private_cli_id_len
- mbedtls_ssl_context
  private_conf
- mbedtls_ssl_context
  private_cur_out_ctr
- mbedtls_ssl_context
  private_disable_datagram_packing
- mbedtls_ssl_context
  private_dtls_srtp_info
- mbedtls_ssl_context
  private_f_export_keys
- mbedtls_ssl_context
  private_f_get_timer
- mbedtls_ssl_context
  private_f_recv
- mbedtls_ssl_context
  private_f_recv_timeout
- mbedtls_ssl_context
  private_f_send
- mbedtls_ssl_context
  private_f_set_timer
- mbedtls_ssl_context
  private_f_vrfy
- mbedtls_ssl_context
  private_handshake
- mbedtls_ssl_context
  private_hostname
- mbedtls_ssl_context
  private_in_buf
- mbedtls_ssl_context
  private_in_cid
- mbedtls_ssl_context
  private_in_ctr
- mbedtls_ssl_context
  private_in_epoch
- mbedtls_ssl_context
  private_in_hdr
- mbedtls_ssl_context
  private_in_hslen
- mbedtls_ssl_context
  private_in_iv
- mbedtls_ssl_context
  private_in_left
- mbedtls_ssl_context
  private_in_len
- mbedtls_ssl_context
  private_in_msg
- mbedtls_ssl_context
  private_in_msglen
- mbedtls_ssl_context
  private_in_msgtype
- mbedtls_ssl_context
  private_in_offt
- mbedtls_ssl_context
  private_in_window
- mbedtls_ssl_context
  private_in_window_top
- mbedtls_ssl_context
  private_keep_current_message
- mbedtls_ssl_context
  private_mtu
- mbedtls_ssl_context
  private_nb_zero
- mbedtls_ssl_context
  private_negotiate_cid
- mbedtls_ssl_context
  private_next_record_offset
- mbedtls_ssl_context
  private_out_buf
- mbedtls_ssl_context
  private_out_cid
- mbedtls_ssl_context
  private_out_ctr
- mbedtls_ssl_context
  private_out_hdr
- mbedtls_ssl_context
  private_out_iv
- mbedtls_ssl_context
  private_out_left
- mbedtls_ssl_context
  private_out_len
- mbedtls_ssl_context
  private_out_msg
- mbedtls_ssl_context
  private_out_msglen
- mbedtls_ssl_context
  private_out_msgtype
- mbedtls_ssl_context
  private_own_cid
- mbedtls_ssl_context
  private_own_cid_len
- mbedtls_ssl_context
  private_own_verify_data
- mbedtls_ssl_context
  private_p_bio
- mbedtls_ssl_context
  private_p_export_keys
- mbedtls_ssl_context
  private_p_timer
- mbedtls_ssl_context
  private_p_vrfy
- mbedtls_ssl_context
  private_peer_verify_data
- mbedtls_ssl_context
  private_renego_records_seen
- mbedtls_ssl_context
  private_renego_status
- mbedtls_ssl_context
  private_secure_renegotiation
- mbedtls_ssl_context
  private_send_alert
- mbedtls_ssl_context
  private_session
- mbedtls_ssl_context
  private_session_in
- mbedtls_ssl_context
  private_session_negotiate
- mbedtls_ssl_context
  private_session_out
- mbedtls_ssl_context
  private_state
- mbedtls_ssl_context
  private_tls_version
- mbedtls_ssl_context
  private_transform
- mbedtls_ssl_context
  private_transform_application
- mbedtls_ssl_context
  private_transform_in
- mbedtls_ssl_context
  private_transform_negotiate
- mbedtls_ssl_context
  private_transform_out
- mbedtls_ssl_context
  private_user_data
- mbedtls_ssl_context
  private_verify_data_len