Calling mysql_server_end calls OpenSSL cleanup functions via vio_end.
This is a problem, as OpenSSL might very well be still used in the application using libmysqlclient.
In my case, it's a plugin that's dynamicaly loaded and unloaded at runtime into an application that itself doesn't use mysql.
The plugin calls mysql_server_init on load, and mysql_server_end on unload, which is the latest point the plugin still has control.
As a result, the application that loads and unloads the plugin is no longer able to accept or initiate any SSL encrypted connections.
Depending on what it does with OpenSSL, it might very well also crash, but i haven't managed to trigger a crash.
Here's a short example on how to trigger the issue:
https://gist.github.com/BtbN/3445c13dc9095f371aa9
{"report":{"fcp":860,"ttfb":225.20000004768372,"pageVisibility":"visible","entityId":43922,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"3dfb0e8c-bd1c-42b6-bd57-bc443a671c08","navigationType":0,"readyForUser":926.6000001430511,"redirectCount":0,"resourceLoadedEnd":552.6000001430511,"resourceLoadedStart":234.30000019073486,"resourceTiming":[{"duration":5.099999904632568,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":234.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":239.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":4.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":234.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":239.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":185.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/b09d0d077992e4331b5f9ec0d3ec448c-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":234.80000019073486,"connectEnd":234.80000019073486,"connectStart":234.80000019073486,"domainLookupEnd":234.80000019073486,"domainLookupStart":234.80000019073486,"fetchStart":234.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":241.60000014305115,"responseEnd":420,"responseStart":255.80000019073486,"secureConnectionStart":234.80000019073486},{"duration":317.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/b47ab3df14096803b180217eb8482517-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":235.30000019073486,"connectEnd":235.30000019073486,"connectStart":235.30000019073486,"domainLookupEnd":235.30000019073486,"domainLookupStart":235.30000019073486,"fetchStart":235.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":242.5,"responseEnd":552.6000001430511,"responseStart":259.5,"secureConnectionStart":235.30000019073486},{"duration":33.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/6c569cbf8087ab04e40d0bef98627457-CDN/lu2bsh/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":235.40000009536743,"connectEnd":235.40000009536743,"connectStart":235.40000009536743,"domainLookupEnd":235.40000009536743,"domainLookupStart":235.40000009536743,"fetchStart":235.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":244.60000014305115,"responseEnd":269.30000019073486,"responseStart":265.5,"secureConnectionStart":235.40000009536743},{"duration":34.700000047683716,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":235.5,"connectEnd":235.5,"connectStart":235.5,"domainLookupEnd":235.5,"domainLookupStart":235.5,"fetchStart":235.5,"redirectEnd":0,"redirectStart":0,"requestStart":245.20000004768372,"responseEnd":270.2000000476837,"responseStart":267.30000019073486,"secureConnectionStart":235.5},{"duration":37.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":235.60000014305115,"connectEnd":235.60000014305115,"connectStart":235.60000014305115,"domainLookupEnd":235.60000014305115,"domainLookupStart":235.60000014305115,"fetchStart":235.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":246.90000009536743,"responseEnd":273.2000000476837,"responseStart":270.40000009536743,"secureConnectionStart":235.60000014305115},{"duration":8.699999809265137,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bsh/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":235.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":235.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":244.5,"responseStart":0,"secureConnectionStart":0},{"duration":62.799999952316284,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":235.80000019073486,"connectEnd":235.80000019073486,"connectStart":235.80000019073486,"domainLookupEnd":235.80000019073486,"domainLookupStart":235.80000019073486,"fetchStart":235.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":249.60000014305115,"responseEnd":298.60000014305115,"responseStart":297,"secureConnectionStart":235.80000019073486},{"duration":10.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bsh/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":235.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":235.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":246.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":39.299999952316284,"initiatorType":"script","name":"https://jira.mariadb.org/s/81b5d7c27af3ebc078cc4a36383678ba-CDN/lu2bsh/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":236.10000014305115,"connectEnd":236.10000014305115,"connectStart":236.10000014305115,"domainLookupEnd":236.10000014305115,"domainLookupStart":236.10000014305115,"fetchStart":236.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":253.20000004768372,"responseEnd":275.40000009536743,"responseStart":273.30000019073486,"secureConnectionStart":236.10000014305115},{"duration":307,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":238.5,"connectEnd":238.5,"connectStart":238.5,"domainLookupEnd":238.5,"domainLookupStart":238.5,"fetchStart":238.5,"redirectEnd":0,"redirectStart":0,"requestStart":266.80000019073486,"responseEnd":545.5,"responseStart":542.8000001907349,"secureConnectionStart":238.5},{"duration":308,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":238.5,"connectEnd":238.5,"connectStart":238.5,"domainLookupEnd":238.5,"domainLookupStart":238.5,"fetchStart":238.5,"redirectEnd":0,"redirectStart":0,"requestStart":272.5,"responseEnd":546.5,"responseStart":543.7000000476837,"secureConnectionStart":238.5},{"duration":49.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":569.8000001907349,"connectEnd":569.8000001907349,"connectStart":569.8000001907349,"domainLookupEnd":569.8000001907349,"domainLookupStart":569.8000001907349,"fetchStart":569.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":588.4000000953674,"responseEnd":619.3000001907349,"responseStart":618.1000001430511,"secureConnectionStart":569.8000001907349},{"duration":251.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":775.6000001430511,"connectEnd":775.6000001430511,"connectStart":775.6000001430511,"domainLookupEnd":775.6000001430511,"domainLookupStart":775.6000001430511,"fetchStart":775.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":998.4000000953674,"responseEnd":1027.3000001907349,"responseStart":1026.3000001907349,"secureConnectionStart":775.6000001430511}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":79,"responseStart":225,"responseEnd":238,"domLoading":229,"domInteractive":977,"domContentLoadedEventStart":977,"domContentLoadedEventEnd":1023,"domComplete":1515,"loadEventStart":1515,"loadEventEnd":1515,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":954.7000000476837},{"name":"bigPipe.sidebar-id.end","time":955.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":955.6000001430511},{"name":"bigPipe.activity-panel-pipe-id.end","time":956.9000000953674},{"name":"activityTabFullyLoaded","time":1039.9000000953674}],"measures":[],"correlationId":"2d5081176f8cf0","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":95,"dbReadsTimeInMs":24,"dbConnsTimeInMs":32,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}