Using a local Unix socket connection via the `--socket-name` or `-S` command line flags should not require SSL by default. (it should set --ssl=False by default)
The MySQL command line interface currently already uses this behavior: https://dev.mysql.com/doc/refman/8.4/en/connection-options.html#option_general_ssl-mode
> Connections over Unix socket files are not encrypted with a mode of PREFERRED. To enforce encryption for Unix socket-file connections, use a mode of REQUIRED or stricter. (However, socket-file transport is secure by default, so encrypting a socket-file connection makes it no more secure and increases CPU load.)
I think MariaDB should also use this behavior, encrypting unix socket connections by default is wasteful and will increase CPU as mentioned above. The default for unix socket should be to not encrypt, with the ability to override and encrypt if required.
Examples:
mariadb -S /cloudsql/my-instance -u root -p
|
...
|
ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it
|
This should succeed without requiring SSL.
{"report":{"fcp":1200.7999999523163,"ttfb":338.5,"pageVisibility":"visible","entityId":133046,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"f8f23cf5-6297-44c8-87b4-f07d0b9d2b29","navigationType":0,"readyForUser":1281.8999998569489,"redirectCount":0,"resourceLoadedEnd":882.5,"resourceLoadedStart":348.89999985694885,"resourceTiming":[{"duration":152.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":348.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":348.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":501.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":152.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":349.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":349.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":501.5,"responseStart":0,"secureConnectionStart":0},{"duration":425.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":349.2999999523163,"connectEnd":349.2999999523163,"connectStart":349.2999999523163,"domainLookupEnd":349.2999999523163,"domainLookupStart":349.2999999523163,"fetchStart":349.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":503.7999999523163,"responseEnd":774.3999998569489,"responseStart":525.2000000476837,"secureConnectionStart":349.2999999523163},{"duration":533.1000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":349.39999985694885,"connectEnd":349.39999985694885,"connectStart":349.39999985694885,"domainLookupEnd":349.39999985694885,"domainLookupStart":349.39999985694885,"fetchStart":349.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":504.59999990463257,"responseEnd":882.5,"responseStart":530.2000000476837,"secureConnectionStart":349.39999985694885},{"duration":189.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":349.5,"connectEnd":349.5,"connectStart":349.5,"domainLookupEnd":349.5,"domainLookupStart":349.5,"fetchStart":349.5,"redirectEnd":0,"redirectStart":0,"requestStart":512.5999999046326,"responseEnd":539.0999999046326,"responseStart":533.3999998569489,"secureConnectionStart":349.5},{"duration":191.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":349.59999990463257,"connectEnd":349.59999990463257,"connectStart":349.59999990463257,"domainLookupEnd":349.59999990463257,"domainLookupStart":349.59999990463257,"fetchStart":349.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":513,"responseEnd":540.8999998569489,"responseStart":535.7000000476837,"secureConnectionStart":349.59999990463257},{"duration":211.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":349.7000000476837,"connectEnd":349.7000000476837,"connectStart":349.7000000476837,"domainLookupEnd":349.7000000476837,"domainLookupStart":349.7000000476837,"fetchStart":349.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":531.8999998569489,"responseEnd":561.5,"responseStart":557.7000000476837,"secureConnectionStart":349.7000000476837},{"duration":175.20000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":349.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":349.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":525,"responseStart":0,"secureConnectionStart":0},{"duration":177.20000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":350,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":350,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":527.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":237.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":350,"connectEnd":350,"connectStart":350,"domainLookupEnd":350,"domainLookupStart":350,"fetchStart":350,"redirectEnd":0,"redirectStart":0,"requestStart":532.2000000476837,"responseEnd":587.7000000476837,"responseStart":585.2999999523163,"secureConnectionStart":350},{"duration":213.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":350.09999990463257,"connectEnd":350.09999990463257,"connectStart":350.09999990463257,"domainLookupEnd":350.09999990463257,"domainLookupStart":350.09999990463257,"fetchStart":350.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":532.5999999046326,"responseEnd":563.2000000476837,"responseStart":559,"secureConnectionStart":350.09999990463257},{"duration":528.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":351,"connectEnd":351,"connectStart":351,"domainLookupEnd":351,"domainLookupStart":351,"fetchStart":351,"redirectEnd":0,"redirectStart":0,"requestStart":821.7000000476837,"responseEnd":879.2999999523163,"responseStart":872.5,"secureConnectionStart":351},{"duration":526.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":353.39999985694885,"connectEnd":353.39999985694885,"connectStart":353.39999985694885,"domainLookupEnd":353.39999985694885,"domainLookupStart":353.39999985694885,"fetchStart":353.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":821.5999999046326,"responseEnd":879.7000000476837,"responseStart":873.2999999523163,"secureConnectionStart":353.39999985694885},{"duration":229.20000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":912.0999999046326,"connectEnd":912.0999999046326,"connectStart":912.0999999046326,"domainLookupEnd":912.0999999046326,"domainLookupStart":912.0999999046326,"fetchStart":912.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1098.5,"responseEnd":1141.2999999523163,"responseStart":1126.7999999523163,"secureConnectionStart":912.0999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":198,"responseStart":338,"responseEnd":351,"domLoading":344,"domInteractive":1373,"domContentLoadedEventStart":1373,"domContentLoadedEventEnd":1413,"domComplete":2318,"loadEventStart":2318,"loadEventEnd":2318,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1312},{"name":"bigPipe.sidebar-id.end","time":1313},{"name":"bigPipe.activity-panel-pipe-id.start","time":1313.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1314.3999998569489},{"name":"activityTabFullyLoaded","time":1427.5999999046326}],"measures":[],"correlationId":"404cbd8a6b30a4","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":70,"dbReadsTimeInMs":13,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Generally, I agree.
The only use case it'll break is when users connect via sockets to accounts with REQUIRE clauses like REQUIRE SSL or REQUIRE ISSUER. It'd be good to have a solution for this. "Do nothing, let them fail" is one possible solution.