Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fhdalikhan/27461530147a0b6eb281f5db1826912b to your computer and use it in GitHub Desktop.
Save fhdalikhan/27461530147a0b6eb281f5db1826912b to your computer and use it in GitHub Desktop.
Generate self signed certificate and add to MariaDB / MySQL
// generate cert
@see https://mariadb.com/kb/en/library/certificate-creation-with-openssl/
// Add to my.ini
@see https://mariadb.com/kb/en/library/securing-connections-for-client-and-server/
[mariadb]
ssl_cert = D:/work/mysql-certs/server-cert.pem
ssl_key = D:/work/mysql-certs/server-key.pem
ssl_ca = D:/work/mysql-certs/cacert.pem
// open hosts file
// add the FQDN which we used to generate cacert.pem, for e.g. we used ClientCertOne as the FQDN for the cert.
127.0.0.1 ClientCertOne
// to verify if ssl is used run below sql
SHOW STATUS LIKE 'Ssl_cipher'
// for PHP laravel
dump( DB::select("SHOW STATUS LIKE 'Ssl_cipher'") );
// another useful link: https://www.digitalocean.com/community/tutorials/how-to-configure-ssl-tls-for-mysql-on-ubuntu-16-04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment