[MDEV-24223] setting up encryption Created: 2020-11-16 Updated: 2022-05-10 Resolved: 2022-05-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Encryption |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Michael Necklas | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
trying to find the path for ssl when its statically linked vs. dynamically linked. the have_ssl variable is disabled. I need the variable settings for the .my.cnf file... tls_version=TLSv1.1,TLSv1.2,TLSv1.3 |
| Comments |
| Comment by Daniel Black [ 2020-11-16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry to come back with more questions than asked, I just don't know what you are asking. Are you talking about compiling the server? Or the connector library? Or using the server? What path are you talking about? The ssl certs (that you've made absolute)? The ssl libraries, include headers. Are you using .my.cnf as a server config or client config? What MariaDB major version? What OS/distro version? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Necklas [ 2020-11-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
i have an existing MariaDB testing environment with a master + read only slave setup. 10.4.12. I'm trying to setup encryption for 1 account. MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'tls_version';
--------------
-------------- MariaDB [(none)]> SHOW VARIABLES LIKE '%SSL%';
--------------------
-------------------- so i'm trying to enable encryption and yes I'm using .my.cnf unlike mysql the .pem files don't exist under the data directory. [mysqld] unlike mysql for MariaDB i have to show the absolute path for the 3 pem files. i ran the ldd and no pem files. i checked under the product directory for the 10.4.12 release and no pem files $ ldd /opt/app/mysql/product/mariadb-10.4.12/bin/mysqld so how do i get their paths to updated the .my.cnf ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Necklas [ 2020-11-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
https://www.cyberciti.biz/faq/how-to-setup-mariadb-ssl-and-secure-connections-from-clients/ I used the above document and ran the opensssl commands and created the .pem files (i skipped step 1+2+5) SSL is still disabled. i used the openssl commands but wolfssl shows on the variables see my attached documentation | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Necklas [ 2020-11-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Forcing connections to the database server for a specific account = external_user to be encrypted! MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'tls_version';
--------------
-------------- MariaDB [(none)]> SHOW VARIABLES LIKE '%SSL%';
--------------------
-------------------- mysql@zlt11307 IDF REPLICATION /opt/app/mysql/data ca-key.pem CA private key $ ldd /opt/app/mysql/product/mariadb-10.4.12/bin/mysqld cd /opt/app/mysql/data $ openssl genrsa 4096 > ca-key.pem $ openssl req -new -x509 -nodes -days 365000 -key ca-key.pem -out ca-cert.pem You are about to be asked to enter information that will be incorporated Country Name (2 letter code) [XX]:US $ openssl req -newkey rsa:4096 -days 365000 -nodes -keyout server-key.pem -out server-req.pem Generating a 4096 bit RSA private key You are about to be asked to enter information that will be incorporated Country Name (2 letter code) [XX]:US Please enter the following 'extra' attributes $ openssl rsa -in server-key.pem -out server-key.pem writing RSA key $ openssl x509 -req -in server-req.pem -days 365000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem Signature ok $ ll *.pem $ chmod 600 *key.pem $ ll *.pem To enable the server for encrypted connections, start it with these lines in the my.cnf file: [mysqld] $ openssl verify -CAfile ca-cert.pem server-cert.pem bounce it then... mysql --execute="SET GLOBAL innodb_fast_shutdown=0";/opt/app/platform/init.d/mysql.server stop MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'tls_version';
--------------
-------------- MariaDB [(none)]> SHOW VARIABLES LIKE '%SSL%';
--------------------
-------------------- instace came online with this error... 2020-11-18 11:11:27 0 [Warning] Failed to setup SSL | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Necklas [ 2020-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
i had a "_" instead of a "-" in the .my.cnf for one of the pem files. so i now have encryption enabled on the MariaDB database server... MariaDB [(none)]> SHOW VARIABLES LIKE '%SSL%';
--------------------
-------------------- $ ll *.pem this database server does not have the mysql client software installed. So now i have an account coming from a remote mysql server that has to encrypt their transactions. ca.pem, client-cert.pem, client-key.pem So what do they need to do for this MariaDB server connection? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Necklas [ 2020-11-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
i figured it out. this can be closed. |