Skip to content

MySQL_GetConnectionTLS

imshooter edited this page Oct 24, 2026 · 1 revision

The TLS version and cipher of the connection of the ordered queries.

native bool:MySQL_GetConnectionTLS(MySQL:handle, tls[], size = sizeof (tls));

Parameters

Parameter Description Default
MySQL:handle Handle to check.
tls[] Array for the version and the cipher, as TLSv1.3 TLS_AES_256_GCM_SHA384, or empty.
size Size of the array. sizeof (tls)

Returns

  • true when the connection is encrypted.
  • false when it is not, it is not open, or the handle does not exist.

Remarks

It gives the TLS version and the cipher, as TLSv1.3 TLS_AES_256_GCM_SHA384, or nothing when the connection is not encrypted. See TLS.

Example

stock PrintTLS(MySQL:handle) {
    new
        tls[64]
    ;

    if (MySQL_GetConnectionTLS(handle, tls)) {
        printf("The database link is encrypted with %s.", tls);
    } else {
        print("The database link is not encrypted.");
    }
}

Related

Clone this wiki locally