### Description
Applies to `db_mysql` built with mariadb-connector-c; TLS is not working
Option 1: configure mariadb server to use TLS (optional)
Option 2: configure mariadb server to use TLS (mandatory)
### Troubleshooting
1. wireshark inspect the pcap dump of traffic to :3306 and look for ClientHello
2. gdb main kamailio process and set breakpoint at `SSL_new`
#### Reproduction
1. Option 1: server advertises SSL, but db_mysql will always choose plain
3. Option 2: server advertises SSL(and …
[View More]requires SSL), connection will fail
### Additional Information
#### Kamailio version
* master
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3735
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3735(a)github.com>
[View Less]
Module: kamailio
Branch: master
Commit: dad7c857eaab613deed27ab687ddd0b1fdf8001b
URL: https://github.com/kamailio/kamailio/commit/dad7c857eaab613deed27ab687ddd0b…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2024-01-30T14:32:10+01:00
modules: readme files regenerated - db_mysql ... [skip ci]
---
Modified: src/modules/db_mysql/README
---
Diff: https://github.com/kamailio/kamailio/commit/…
[View More]dad7c857eaab613deed27ab687ddd0b…
Patch: https://github.com/kamailio/kamailio/commit/dad7c857eaab613deed27ab687ddd0b…
---
diff --git a/src/modules/db_mysql/README b/src/modules/db_mysql/README
index 8d9f526cbe1..8e135cdcbf2 100644
--- a/src/modules/db_mysql/README
+++ b/src/modules/db_mysql/README
@@ -94,7 +94,9 @@ Chapter 1. Admin Guide
The following libraries or applications must be installed before
running Kamailio with this module loaded:
* mysql - the development libraries for the MySQL database. In some
- Linux distributions named "libmysqlclient-dev".
+ Linux distributions named "libmysqlclient-dev". MariaDB - the
+ development libraries for the MariaDB database. In some Linux
+ distributions named "libmariadbclient-dev".
3. Parameters
@@ -199,8 +201,9 @@ modparam("db_mysql", "update_affected_found", 1)
SSL_MODE_DISABLED, any other value is passed to the mysql_options(),
not checking if it is defined.
- Note: this option is supported only by libmysqlclient, not by
- libmariadbclient.
+ MariaDB client configuration uses the following values: 0, 1 use plain,
+ 2/3/4 for MYSQL_OPT_SSL_ENFORCE, 5 for MYSQL_OPT_SSL_VERIFY_SERVER_CERT
+ (see MariaDB Connector/C documentation) Other values are ignored.
Default value is 0 (0 - off).
[View Less]
#### Pre-Submission Checklist
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [X] New …
[View More]feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
- [X] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
When db_mysql is built with mariadb-connector-c it does not use TLS and fails if the server requires TLS. It seems to be related to the fact that the MYSQL object needs to have a minimal non-NULL configuration (unlike MySQL Connector/C).
This is a minimal setting to allow TLS. A more full-featured solution would be to enable db_mysql to read from an external configuration file.
@linuxmaniac, kindly take a look
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3734
-- Commit Summary --
* db_mysql: enable TLS when building with mariadb-connector-c
-- File Changes --
M src/modules/db_mysql/km_my_con.c (9)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3734.patchhttps://github.com/kamailio/kamailio/pull/3734.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3734
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3734(a)github.com>
[View Less]