Configure an SSL/TLS Connection to Tessell MySQL
Download the CA certificate, create an SSL-only MySQL user, connect with certificate and hostname verification, and troubleshoot SSL/TLS connections to your Tessell MySQL service.
Tessell MySQL supports SSL/TLS-encrypted connections between client applications and the database service. SSL/TLS protects data in transit from being read or modified between the client and the database.
This guide covers how to:
Download the CA certificate from the Tessell Console.
Create a MySQL user that requires SSL/TLS.
Connect securely using the MySQL command-line client.
Verify that the connection is encrypted.
Handle hostname verification over PrivateLink and troubleshoot common errors.
Note: Configuring SSL/TLS in application drivers (JDBC, ODBC, Python, Go, and so on) is beyond the scope of this guide. The same concepts apply — supply the CA certificate and choose a verification mode. Refer to your driver's documentation for driver-specific options.
Prerequisites
A running Tessell MySQL DB service with SSL enabled. SSL is enabled in the Connectivity settings at provisioning time — see Provisioning a MySQL service. If SSL was not enabled for your service, contact Tessell Support.
Network connectivity from the client machine to the database host and port (default 3306). Your client IP or CIDR must be listed under Allowed IP addresses on the service's Overview tab.
The connection details from the service's Overview tab: Host, Port, Database, and Username. See Overview.
A MySQL client installed on the client machine. MySQL client 8.0 or later is recommended.
A MySQL administrative account with privileges to create users and grant permissions.
Step 1 — Download the CA certificate
The CA certificate lets the client verify that the certificate presented by the MySQL server was issued by a trusted authority.
Sign in to the Tessell Console.
From the left navigation pane, go to DB Services and open the My Services app.
Select your MySQL DB service.
On the Overview tab, locate the CA certificate section.
Download the CA certificate.
Copy the certificate to the client machine from which you will connect.
Save the certificate in a dedicated directory on the client machine. For example:
Verify that the certificate exists, is readable, and is within its validity period:
Note: The CA certificate is public trust material, not a private key. You do not need to modify any server-side certificate or key files to configure a client connection.
Step 2 — Create a MySQL user that requires SSL
Connect to the database using an administrative account, then create a dedicated application user that can only connect over an encrypted connection:
Grant the user only the privileges the application needs:
Important: The host pattern
%allows connections from any host and is used here for illustration only. In production, restrict the account to the specific client host or network range where practical (for example,'ssl_user'@'10.0.1.%').
What does REQUIRE SSL do?
REQUIRE SSL allows the account to connect only over an encrypted connection. A connection attempt without encryption is rejected with an Access denied error. It does not require the client to present its own X.509 client certificate.
To enforce SSL for an existing user:
Verify the account configuration:
The output of SHOW CREATE USER includes REQUIRE SSL when the requirement is in effect.
For more information, see the MySQL documentation for CREATE USER.
Step 3 — Connect using the MySQL command-line client
Use the Host value from the service's Overview tab for <tessell-mysql-host>. For HA services, Tessell keeps this hostname pointed at the current primary, so always connect using it.
The --ssl-mode option controls how strictly the client enforces and verifies SSL/TLS:
--ssl-mode
Encrypts traffic
Verifies CA
Verifies hostname
Recommended use
PREFERRED (client default)
If the server supports it
No
No
Not recommended — silently falls back to unencrypted
REQUIRED
Yes
No
No
Basic testing only
VERIFY_CA
Yes
Yes
No
When the connection hostname cannot match the certificate
VERIFY_IDENTITY
Yes
Yes
Yes
Production
Option A — Require encryption
Enter the password when prompted. This mode guarantees encryption but does not verify the server's identity, so it does not protect against an impersonated server.
Option B — Verify the CA certificate
This mode requires encryption and validates the server certificate against the Tessell CA certificate.
Option C — Verify the CA and server hostname (recommended)
This mode validates the certificate chain and checks that the hostname passed in --host matches the identity in the server certificate.
Recommendation: Use
VERIFY_IDENTITYfor production connections. If you get any error, please see Troubleshooting.
Step 4 — Verify the SSL/TLS connection
After connecting, run:
Example output:
A non-empty
Ssl_ciphervalue confirms that the current session is encrypted.Ssl_versionshows the TLS protocol version in use.An empty value means the current session is not encrypted.
The exact cipher and TLS version depend on the server and client versions and configuration.
You can also run \s (or status) in the MySQL client. The SSL: line shows the cipher in use, or Not in use if the session is unencrypted.
Server-level secure transport setting
MySQL also has a server-level variable, require_secure_transport. Check its current value:
When this variable is ON, the server rejects all unencrypted TCP connections, regardless of whether an individual account has REQUIRE SSL.
REQUIRE SSL
A specific MySQL account
CREATE USER / ALTER USER
require_secure_transport=ON
All connections to the server
Server configuration (DB parameter profile)
On Tessell, server parameters are managed through the service's DB parameter profile. Review your service configuration and organizational policies before changing server-level settings, and contact Tessell Support if you need assistance.
For more information, see the MySQL documentation for Configuring MySQL to Use Encrypted Connections.
PrivateLink endpoints and hostname verification
When a client connects through a PrivateLink endpoint, the hostname the client uses may differ from the hostname in the server certificate. For example:
Server certificate identity:
<service-name>.<tessell-domain>Hostname used by the application: a cloud VPC endpoint DNS name
With --ssl-mode=VERIFY_IDENTITY, the hostname passed to the client must match a name in the server certificate's hostname. If it does not, the connection fails with a hostname mismatch — even when the CA certificate is correct.
To resolve this:
Confirm the exact hostname the application uses to connect.
Inspect the SAN entries of the server certificate (requires OpenSSL 1.1.1 or later):
Check whether the hostname used by application appears in the output of previous command.
If it does not, contact Tessell Support to align the PrivateLink endpoint DNS and certificate configuration — for example, PrivateLink DNS name matches with the DNS name in the certificate.
Retest the connection with
--ssl-mode=VERIFY_IDENTITY.
Warning: Do not disable hostname verification as a permanent workaround for a hostname mismatch. If you must use
VERIFY_CAtemporarily, track it as a known gap and return toVERIFY_IDENTITYonce the configuration is corrected.
Troubleshooting
ERROR 1045 (28000): Access denied for user
Incorrect credentials, host pattern mismatch, or the account has REQUIRE SSL but the connection is unencrypted
Verify the password and account host pattern. Connect with --ssl-mode=REQUIRED or stronger.
ERROR 3159 (HY000): Connections using insecure transport are prohibited while --require_secure_transport=ON
The server requires secure transport, but the connection is not encrypted
Connect with --ssl-mode=REQUIRED or stronger.
ERROR 2026 (HY000): SSL connection error: CA certificate is required if ssl-mode is VERIFY_CA or VERIFY_IDENTITY
--ssl-mode=VERIFY_CA or VERIFY_IDENTITY was used without --ssl-ca
Add --ssl-ca=<path-to-CA-certificate>.
ERROR 2026 (HY000): SSL connection error: ... certificate verify failed
Wrong CA certificate, expired certificate, or incorrect --ssl-ca path. The --host value does not match with hostname in the server certificate
Download the current CA certificate from the Overview tab and check its validity with openssl x509 -dates. Connect using the Host from the Overview tab. For PrivateLink, see PrivateLink endpoints and hostname verification.
Ssl_cipher is empty
The session is not encrypted (client used PREFERRED or DISABLED)
Reconnect with an explicit --ssl-mode of REQUIRED or stronger and recheck.
Production readiness checklist
Before using SSL/TLS for an application in production:
References
Tessell — Provisioning a MySQL service
Tessell Help Center — How are SSL certificates configured for databases?
MySQL 8.0 — CREATE USER Statement
MySQL 8.0 — Configuring MySQL to Use Encrypted Connections
MySQL 8.0 — Command Options for Encrypted Connections
Last updated
Was this helpful?