Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HammerDB: Passwordless MariaDB connection #408

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

igorkonopko
Copy link
Contributor

When using SSL connection to MariaDB we are able to authenticate user solely based on SSL subject and issuer. In such a case we need to pass SSL certificate and SSL key to authenticate and we cannot pass user password, because such an user might not have an password set, which is the goal of such an configuration. Currently HammerDB always append '-password' to connection string, so we are not able to connect to MariaDB with user configured as described above. This patch adds the ability to use special keyword "null" in order to skip appending password to connection string. Such a special keyword instead of empty string was chosen in order to avoid breaking other layers of HammerDB and in order to keep the number of changes minimal.

Signed-off-by: Igor Konopko igor.j.konopko@intel.com

Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
Copy link
Contributor

@sm-shaw sm-shaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have verified that this works as intended. To work it needs the MariaDB user created without password authentication e.g.

MariaDB [(none)]> create user 'steve'@'localhost' require x509;
Query OK, 0 rows affected (0.003 sec)
MariaDB [(none)]> grant all on *.* to 'steve'@'localhost';
Query OK, 0 rows affected (0.003 sec)

With connection options and output as follows:

-host 127.0.0.1 -port 3306 -ssl true -sslca /opt/mariadb-10.8.1-linux-x86_64/ssl/ca-cert.pem -sslcert /opt/mariadb-10.8.1-linux-x86_64/ssl/client-cert.pem -sslkey /opt/mariadb-10.8.1-linux-x86_64/ssl/client-key.pem -user steve

Vuser 1:Ssl_cipher ECDHE-RSA-AES128-GCM-SHA256
Vuser 1:Processing 1 transactions without output suppressed...
Vuser 1:order status
Vuser 1:1447 ATIONEINGBAR HaQker30A OE -10.00 1239 2022-08-11 16:14:55 3

Example options for testing:
mdbopts

Example output:
mdbrun

@abondvt89 abondvt89 merged commit 4b508c1 into TPC-Council:master Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants