Handshake

You are viewing an old version of this article. View the current version here.

Server handshake package 1

Fields

1          protocol version (0xA)
str_6      version prefix for MySQL replication = 5.5.5-
str_NUL    MariaDB server version
int_4      thread/connection id
str_8      authentication: scramble (1st part)
int_2      server capabilities (1st part)
int_1      server character set
int_2      status flags
int_2      server capabilities (2nd part)
int_1      length of 2nd scramble packet
if !(server_capabilities & CLIENT_MYSQL) /* since 10.2 */
{
  str_6    filler
  int_4    mariadb specific server capabilities
}
else
  str_10   filler
if (server_capabilities & CLIENT_SECURE_CONNECTION)
str        2nd scramble packet
str_NUL    authentication plugin name

Client handshake package 1

If the client requests a TLS/SSL connection this package will be sent in two parts, between a TLS/SSL handshake will be performed and 2nd packet will be transfered encrypted.

Fields

int_4      client capabilities
int_4      max packet size
int_1      client character set nr
str_19     reserved
if !(server_capabilities & CLIENT_MYSQL)
  int_4    extended client capabilities
else
  str_4    reserved
-----------------------------------------
if (server_capabilities & CLIENT_SSL &&
    client_capabilities & CLIENT_SSL)
  perform_ssl_handshake;
-----------------------------------------
str_NULL   username

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.