MySQL
By default, the MySQL Connector/J JDBC driver will automatically connect via SSL/TLS if the server supports it. To force encrypted traffic at all times, use the sslMode parameter:
jdbc:mysql://localhost:3306/mirthdb?sslMode=VERIFY_IDENTITY |
The above mode makes sure that SSL/TLS is always used, the server cert is trusted, and hostname verification is also performed.
For a more lenient and less secure connection (but still using SSL/TLS), you can also use the VERIFY_CA option which skips the hostname verification, or the REQUIRED option which doesn't require the server cert to be trusted and will work for self-signed certs.
Consult these online documentation pages for more information: