Skip to content
imshooter edited this page Nov 29, 2026 · 1 revision

A connection uses TLS when any option of TLS is given. It then never runs without it, and fails when the server answers without TLS.

Option In mysql.ini Value
SSL_ENABLE ssl_enable require TLS
SSL_VERIFY ssl_verify verify the certificate of the server and its name
SSL_CA_FILE ssl_ca_file certificate authorities, a file
SSL_CA_PATH ssl_ca_path certificate authorities, a folder
SSL_CRL_FILE ssl_crl_file revocation lists, a file
SSL_CRL_PATH ssl_crl_path revocation lists, a folder
SSL_CERT_FILE ssl_cert_file certificate of the client
SSL_KEY_FILE ssl_key_file key of the client
SSL_CIPHER ssl_cipher ciphers allowed
TLS_VERSION tls_version versions allowed, as TLSv1.2,TLSv1.3
SSL_FINGERPRINT ssl_fingerprint SHA1 to SHA512 fingerprint the certificate of the server must have

On localhost, 127.0.0.1 and ::1 the name is not checked, and the authority only when one is given. A fingerprint suits a certificate signed by no authority. mysql_get_tls gives the version and cipher in use.

hostname = db.example.com
username = game
password = ${MYSQL_PASSWORD}
database = game
ssl_verify = true
ssl_ca_file = ca.pem

Home

Guides

Reference

Functions

Connections
Queries
Cache
JSON cells
ORM
Queries built in pieces
Prepared statements
Batches
Transactions
Passwords
Callbacks

Clone this wiki locally