Skip to main content

build_ssl_request_packet

Function build_ssl_request_packet 

Source
pub fn build_ssl_request_packet(
    client_caps: u32,
    max_packet_size: u32,
    character_set: u8,
    sequence_id: u8,
) -> Vec<u8> 
Expand description

Build an SSL request packet.

This packet is sent after receiving the server handshake and before performing the TLS handshake. It tells the server that we want to upgrade to TLS.

§Format

  • capability_flags (4 bytes): Client capabilities with CLIENT_SSL set
  • max_packet_size (4 bytes): Maximum packet size
  • character_set (1 byte): Character set code
  • reserved (23 bytes): All zeros

Total: 32 bytes