Type:
Task
Priority:
Critical
Resolution:
Fixed
If the client provides --ssl-* options, but a TLS connection to the server is not possible, then the client simply silently ignores the provided --ssl-* options if the --ssl-verify-server-cert option is not also provided. The user may think that their connection is encrypted, but it is not.
The current behavior is probably the "expected" behavior according to Engineering. See MDEV-16409 for some details on previous discussion. However, I don't think this behavior is the behavior that would be expected by most users. When implementing security features, the industry standard for design is to fail safe. Security features may be mandatory for compliance reasons, and the fault of a security control may silently increase risk.
Consider an example: if you typed https://mybank.com into your browser's URL bar, would you be happy if the browser silently used an unencrypted connection, even though you requested HTTPS? This is basically what MariaDB's clients are doing.
For example, let's say that TLS is not enabled on our server:
$ sudo mariadb --execute="SHOW GLOBAL VARIABLES LIKE 'ssl%'"
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| ssl_ca | |
| ssl_capath | |
| ssl_cert | |
| ssl_cipher | |
| ssl_crl | |
| ssl_crlpath | |
| ssl_key | |
+---------------+-------+
If a client tries to connect via TLS, then they will not see an error, and their connection will be unencrypted:
$ mariadb --user=myuser --password=password --host=127.0.0.1 --ssl --ssl-ca=/home/vagrant/ca.pem --execute="SHOW SESSION STATUS LIKE 'Ssl_cipher'"
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Ssl_cipher | |
+---------------+-------+
The client will only see an error if they also provide the --ssl-verify-server-cert option:
$ mariadb --user=myuser --password=password --host=127.0.0.1 --ssl --ssl-ca=/home/vagrant/ca.pem --ssl-verify-server-cert --execute="SHOW SESSION STATUS LIKE 'Ssl_cipher'"
ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it
MySQL fixed this problem by introducing the --ssl-mode client option in MySQL 5.7.11 that provides more configurable TLS behavior.
https://dev.mysql.com/doc/refman/5.7/en/connection-options.html#option_general_ssl-mode
Part of the new MySQL behavior made it so that if the client specifies the --ssl-ca or --ssl-capath option, then that will imply --ssl-mode=VERIFY_CA. by default.
The --ssl-mode option interacts with CA certificate options as follows:
If --ssl-mode is not explicitly set otherwise, use of --ssl-ca or --ssl-capath implies --ssl-mode=VERIFY_CA.
For --ssl-mode values of VERIFY_CA or VERIFY_IDENTITY, --ssl-ca or --ssl-capath is also required, to supply a CA certificate that matches the one used by the server.
An explicit --ssl-mode option with a value other than VERIFY_CA or VERIFY_IDENTITY, together with an explicit --ssl-ca or --ssl-capath option, produces a warning that no verification of the server certificate will be done, despite a CA certificate option being specified.
In my opinion, we should take one of the following actions:
Throw a warning if the client provides --ssl-* options, but a TLS connection to the server is not possible.
Or make the --ssl-ca and --ssl-capath options imply the --ssl-verify-server-cert option by default (similar to MySQL 5.7+ behavior).
Or port MySQL's --ssl-mode behavior.
Jacob Moorman (Inactive)
made changes -
2020-07-11 17:48
Component/s
Scripts & Clients
[ 14977
]
Component/s
SSL
[ 14980
]
Component/s
Scripts & Clients
[ 11002
]
Component/s
SSL
[ 10112
]
Fix Version/s
10.2
[ 23606
]
Fix Version/s
10.3
[ 23605
]
Fix Version/s
10.4
[ 23604
]
Fix Version/s
10.5
[ 23608
]
Fix Version/s
10.2
[ 14601
]
Fix Version/s
10.1
[ 16100
]
Fix Version/s
10.3
[ 22126
]
Fix Version/s
10.4
[ 22408
]
Fix Version/s
10.5
[ 23123
]
Key
MDEV-23148
MENT-861
Affects Version/s
10.1.45
[ 23913
]
Affects Version/s
10.2.32
[ 24221
]
Affects Version/s
10.3.23
[ 24222
]
Affects Version/s
10.4.13
[ 24223
]
Affects Version/s
10.5.4
[ 24264
]
Project
MariaDB Server
[ 10000
]
MariaDB Enterprise
[ 11500
]
Geoff Montee (Inactive)
made changes -
2020-07-11 18:13
Affects Version/s
10.2
[ 23606
]
Affects Version/s
10.3
[ 23605
]
Affects Version/s
10.4
[ 23604
]
Affects Version/s
10.5
[ 23608
]
Sergei Golubchik
made changes -
2021-12-06 21:28
Workflow
MariaDB v3
[ 111130
]
MariaDB v4
[ 135817
]
Julien Fritsch
made changes -
2021-12-23 11:28
Issue Type
Bug
[ 1
]
New Feature
[ 2
]
Sergei Golubchik
made changes -
2022-05-20 13:23
Component/s
Scripts & Clients
[ 11002
]
Component/s
SSL
[ 10112
]
Component/s
Scripts & Clients
[ 14977
]
Component/s
SSL
[ 14980
]
Fix Version/s
10.10
[ 27530
]
Fix Version/s
10.4
[ 23604
]
Fix Version/s
10.3
[ 23605
]
Fix Version/s
10.2
[ 23606
]
Fix Version/s
10.5
[ 23608
]
Key
MENT-861
MDEV-28634
Affects Version/s
10.4
[ 23604
]
Affects Version/s
10.3
[ 23605
]
Affects Version/s
10.2
[ 23606
]
Affects Version/s
10.5
[ 23608
]
Issue Type
New Feature
[ 2
]
Task
[ 3
]
Project
MariaDB Enterprise
[ 11500
]
MariaDB Server
[ 10000
]
Sergei Golubchik
made changes -
2022-05-20 19:36
Status
Open
[ 1
]
In Progress
[ 3
]
Sergei Golubchik
made changes -
2022-05-20 19:36
Status
In Progress
[ 3
]
Stalled
[ 10000
]
Sergei Golubchik
made changes -
2022-05-20 19:36
Status
Stalled
[ 10000
]
In Testing
[ 10301
]
Elena Stepanova
made changes -
2022-07-21 21:21
Assignee
Sergei Golubchik
[ serg
]
Ramesh Sivaraman
[ JIRAUSER48189
]
Sergei Golubchik
made changes -
2022-07-27 20:48
Assignee
Ramesh Sivaraman
[ JIRAUSER48189
]
Sergei Golubchik
[ serg
]
Sergei Golubchik
made changes -
2022-07-27 20:48
Status
In Testing
[ 10301
]
Stalled
[ 10000
]
Ralf Gebhardt
made changes -
2022-08-24 10:23
Fix Version/s
10.11
[ 27614
]
Fix Version/s
10.10
[ 27530
]
Ralf Gebhardt
made changes -
2022-09-20 17:29
Fix Version/s
10.12
[ 28320
]
Fix Version/s
10.11
[ 27614
]
Ralf Gebhardt
made changes -
2022-12-30 15:43
Fix Version/s
11.1
[ 28549
]
Fix Version/s
11.0
[ 28320
]
Ralf Gebhardt
made changes -
2022-12-30 15:43
Priority
Major
[ 3
]
Critical
[ 2
]
Ralf Gebhardt
made changes -
2023-05-30 08:57
Fix Version/s
11.3
[ 28565
]
Fix Version/s
11.1
[ 28549
]
Daniel Lenski (Inactive)
made changes -
2023-06-15 21:07
Remote Link
This issue links to "mariadb-connector-c PR #224 (Web Link)"
[ 35455
]
Sergei Golubchik
made changes -
2023-06-28 19:00
Status
Stalled
[ 10000
]
Needs Feedback
[ 10501
]
Sergei Golubchik
made changes -
2023-07-04 12:31
Status
Needs Feedback
[ 10501
]
Open
[ 1
]
Ralf Gebhardt
made changes -
2023-09-21 13:47
Fix Version/s
11.3
[ 28565
]
Sergei Golubchik
made changes -
2024-02-05 10:16
Fix Version/s
11.4.1
[ 29523
]
Resolution
Fixed
[ 1
]
Status
Open
[ 1
]
Closed
[ 6
]
{"report":{"fcp":1173.8999998569489,"ttfb":461.7999999523163,"pageVisibility":"visible","entityId":89421,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"38e7185c-1c80-4e09-8c61-9f3c4a80126e","navigationType":0,"readyForUser":1302.7999999523163,"redirectCount":0,"resourceLoadedEnd":1406.2999999523163,"resourceLoadedStart":480.39999985694885,"resourceTiming":[{"duration":107.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":480.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":480.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":587.8999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":107.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":480.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":480.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":588.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":212.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":480.89999985694885,"connectEnd":480.89999985694885,"connectStart":480.89999985694885,"domainLookupEnd":480.89999985694885,"domainLookupStart":480.89999985694885,"fetchStart":480.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":589.0999999046326,"responseEnd":693.5999999046326,"responseStart":613.7999999523163,"secureConnectionStart":480.89999985694885},{"duration":394.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":481.09999990463257,"connectEnd":481.09999990463257,"connectStart":481.09999990463257,"domainLookupEnd":481.09999990463257,"domainLookupStart":481.09999990463257,"fetchStart":481.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":804.2999999523163,"responseEnd":875.7999999523163,"responseStart":818.7999999523163,"secureConnectionStart":481.09999990463257},{"duration":337.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":481.2999999523163,"connectEnd":481.2999999523163,"connectStart":481.2999999523163,"domainLookupEnd":481.2999999523163,"domainLookupStart":481.2999999523163,"fetchStart":481.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":804.5999999046326,"responseEnd":818.5,"responseStart":816.8999998569489,"secureConnectionStart":481.2999999523163},{"duration":342.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":481.5,"connectEnd":481.5,"connectStart":481.5,"domainLookupEnd":481.5,"domainLookupStart":481.5,"fetchStart":481.5,"redirectEnd":0,"redirectStart":0,"requestStart":806.5,"responseEnd":823.8999998569489,"responseStart":821.7999999523163,"secureConnectionStart":481.5},{"duration":343.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":481.59999990463257,"connectEnd":481.59999990463257,"connectStart":481.59999990463257,"domainLookupEnd":481.59999990463257,"domainLookupStart":481.59999990463257,"fetchStart":481.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":808.7999999523163,"responseEnd":825.5,"responseStart":824.3999998569489,"secureConnectionStart":481.59999990463257},{"duration":333.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":481.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":481.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":815.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":362.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":481.7999999523163,"connectEnd":481.7999999523163,"connectStart":481.7999999523163,"domainLookupEnd":481.7999999523163,"domainLookupStart":481.7999999523163,"fetchStart":481.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":811.3999998569489,"responseEnd":844.2999999523163,"responseStart":840.2999999523163,"secureConnectionStart":481.7999999523163},{"duration":333.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":482,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":482,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":815.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":361.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":482.19999980926514,"connectEnd":482.19999980926514,"connectStart":482.19999980926514,"domainLookupEnd":482.19999980926514,"domainLookupStart":482.19999980926514,"fetchStart":482.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":812.5,"responseEnd":843.2999999523163,"responseStart":838.6999998092651,"secureConnectionStart":482.19999980926514},{"duration":495.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":505,"connectEnd":505,"connectStart":505,"domainLookupEnd":505,"domainLookupStart":505,"fetchStart":505,"redirectEnd":0,"redirectStart":0,"requestStart":988.6999998092651,"responseEnd":1000.6999998092651,"responseStart":1000.0999999046326,"secureConnectionStart":505},{"duration":889.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":516.5,"connectEnd":516.5,"connectStart":516.5,"domainLookupEnd":516.5,"domainLookupStart":516.5,"fetchStart":516.5,"redirectEnd":0,"redirectStart":0,"requestStart":1393.6999998092651,"responseEnd":1406.2999999523163,"responseStart":1405.1999998092651,"secureConnectionStart":516.5},{"duration":174.80000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":821.1999998092651,"connectEnd":821.1999998092651,"connectStart":821.1999998092651,"domainLookupEnd":821.1999998092651,"domainLookupStart":821.1999998092651,"fetchStart":821.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":960.5,"responseEnd":996,"responseStart":995.2999999523163,"secureConnectionStart":821.1999998092651},{"duration":332.10000014305115,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1111.3999998569489,"connectEnd":1111.3999998569489,"connectStart":1111.3999998569489,"domainLookupEnd":1111.3999998569489,"domainLookupStart":1111.3999998569489,"fetchStart":1111.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":1406.5,"responseEnd":1443.5,"responseStart":1442.5,"secureConnectionStart":1111.3999998569489}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":81,"responseStart":462,"responseEnd":516,"domLoading":466,"domInteractive":1457,"domContentLoadedEventStart":1457,"domContentLoadedEventEnd":1523,"domComplete":2029,"loadEventStart":2029,"loadEventEnd":2030,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1407.7999999523163},{"name":"bigPipe.sidebar-id.end","time":1408.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1408.8999998569489},{"name":"bigPipe.activity-panel-pipe-id.end","time":1418.1999998092651},{"name":"activityTabFullyLoaded","time":1546.5999999046326}],"measures":[],"correlationId":"312f06a1ef7ea0","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":286,"dbReadsTimeInMs":55,"dbConnsTimeInMs":67,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}