{"id":11553,"date":"2024-05-27T08:19:17","date_gmt":"2024-05-27T00:19:17","guid":{"rendered":"https:\/\/www.orczhou.com\/?p=11553"},"modified":"2024-05-27T08:19:17","modified_gmt":"2024-05-27T00:19:17","slug":"sysbench-mysql-ssl-tls-support","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2024\/05\/sysbench-mysql-ssl-tls-support\/","title":{"rendered":"Sysbench\u8001\u7248\u672c\u538b\u6d4bMySQL\u652f\u6301SSL\/TLS\u7684\u95ee\u9898"},"content":{"rendered":"\n<p>\u539f\u672c\u6211\u4e00\u76f4\u662f\u4f7f\u7528\u5404\u4e2aYUM\u4ed3\u5e93\u4e2d\u9ed8\u8ba4\u7684sysbench\u7248\u672c\u7684\uff0c\u4e3b\u8981\u662f\u8003\u8651\u5b89\u88c5\u90e8\u7f72\u65b9\u4fbf\uff0c\u800c\u4e00\u76f4\u4ee5\u6765\u8fd9\u4e2a\u7248\u672c\u4f3c\u4e4e\u90fd\u6ca1\u6709\u9047\u5230\u4ec0\u4e48\u95ee\u9898\uff0c\u76f4\u5230&#8230;\u5c1d\u8bd5\u81ea\u52a8\u5316\u7684\u5bf9Azure\u4e0a\u7684MySQL\u8fdb\u884c\u538b\u6d4b\u3002<\/p>\n\n\n\n<p>\u9ed8\u8ba4\u7684sysbench\u7248\u672c\u662f<a href=\"https:\/\/github.com\/akopytov\/sysbench\/tree\/1.0.17\">1.0.17\u7248\uff08Mar 15, 2019\uff09<\/a>\uff0c\u9996\u5148\uff0c\u662f\u9047\u5230\u4e86\u5982\u4e0b\u7684\u62a5\u9519\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">sysbench 1.0.17 (using system LuaJIT 2.0.4)\n\nFATAL: unable to connect to MySQL server on host 'xxx.mysql.database.azure.com', port 3306, aborting...\nFATAL: error 3159: Connections using insecure transport are prohibited while --require_secure_transport=ON<\/code><\/pre>\n\n\n\n<p>\u5728\u8be5\u7248\u672c\u4e2d\uff0csysbench\u63d0\u4f9b\u4e86\u53c2\u6570<code>--mysql-ssl=[on|off]<\/code>\u4ee5\u5c1d\u8bd5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u4f46\u5bf9\u4e8e\u6700\u65b0\u7248\u672c\u7684MySQL\uff0c\u8be5\u53c2\u6570\u5f88\u591a\u65f6\u5019\u90fd\u65e0\u6cd5\u6b63\u5e38\u5de5\u4f5c\uff0c\u5982\u679c\u4f60\u4e5f\u5c1d\u8bd5\u4e86\u8be5\u53c2\u6570\uff0c\u90a3\u4e48\u4f1a\u62a5\u5982\u4e0b\u9519\u8bef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">FATAL: unable to connect to MySQL server on host 'xxx.mysql.database.azure.com', port 3306, aborting...\nFATAL: error 2026: SSL connection error: SSL_CTX_set_default_verify_paths failed<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\uff0c\u6070\u597d\uff0c\u4f60\u6ce8\u610f\u4e0a\u9762\u7684\u62a5\u9519\u53ef\u80fd\u662f<code>CA<\/code>\u8bc1\u4e66\u7684\u95ee\u9898\uff0c\u4e8e\u662f\u4f60\u4e5f\u50cf\u6211\u4e00\u6837\u5c1d\u8bd5\u901a\u8fc7 \u4e0b\u8f7d\u8bc1\u4e66\u7684\u65b9\u5f0f\u53bb\u89e3\u51b3\uff0c\u5e76\u901a\u8fc7GitHub\u4e0a\u7684issue\uff0c\u6210\u529f\u5c06<code>CA<\/code>\u8bc1\u4e66\u6539\u540d\u6210cacert.pem\uff0c\u5e76\u653e\u5728\u5f53\u524d\u7684\u8def\u5f84\u4e0b\uff0c\u90a3\u4e48\u4f60\u8fd8\u4f1a\u9047\u5230\u5982\u4e0b\u62a5\u9519\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">SSL error: Unable to get certificate from 'client-cert.pem'\nFATAL: unable to connect to MySQL server on host 'xxx.mysql.database.azure.com', port 3306, aborting...\nFATAL: error 2026: SSL connection error: Unable to get certificate<\/code><\/pre>\n\n\n\n<p>\u597d\u4e86\uff0c\u4e5f\u8bb8\u4f60\u518d\u6210\u529f\u751f\u6210<code>client-cert.pem<\/code>\u3001<code>client-key.pem<\/code>\u7684\u8bdd\uff0c\u4e5f\u8bb8\u4f60\u771f\u7684\u80fd\u591f\u8fd0\u884c\u6210\u529f\u3002\u4e0d\u8fc7\uff0c\u518d\u5411\u540e\uff0c\u6211\u5c31\u6ca1\u6709\u5c1d\u8bd5\u4e86\uff0c\u539f\u56e0\u662f\uff0c\u5982\u679c\u6bcf\u4e00\u6b21\u6d4b\u8bd5\u90fd\u53bb\u83b7\u5f97\u5404\u4e00\u4e2a\u8eab\u4efd\u8ba4\u8bc1\u7684\u5bc6\u94a5\u5bf9\uff0c\u90a3\u4e48\u5b9e\u5728\u662f\u592a\u590d\u6742\u4e86\u3002<\/p>\n\n\n\n<p>\u6700\u7ec8\uff0c\u6211\u6839\u636eAWS\u4e0a<a href=\"https:\/\/aws.amazon.com\/cn\/blogs\/database\/running-sysbench-on-rds-mysql-rds-mariadb-and-amazon-aurora-mysql-via-ssl-tls\/\">\u8fd9\u7bc7\u6587\u7ae0\uff08Running sysbench on RDS MySQL&#8230; via SSL\/TLS\uff09<\/a>\u7684\u5efa\u8bae\uff0c\u5c1d\u8bd5\u81ea\u5df1\u7f16\u8bd1\u5b89\u88c5\u4e86\u6700\u65b0\u7248\u672c\u7684sysbench\uff0c\u4e5f\u5c31\u662f1.1.0\u7248\u672c\u3002\u7136\u540e\u7b80\u5355\u7684\u4f7f\u7528\u53c2\u6570<code>--mysql-ssl=preferred<\/code>\u6216<code>--mysql-ssl=required<\/code>\u5f7b\u5e95\u7684\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u53c2\u8003\u6587\u6863<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/akopytov\/sysbench\/tree\/1.0.17\">1.0.17\u7248\uff08Mar 15, 2019\uff09<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/aws.amazon.com\/cn\/blogs\/database\/running-sysbench-on-rds-mysql-rds-mariadb-and-amazon-aurora-mysql-via-ssl-tls\/\">Running sysbench on RDS MySQL, RDS MariaDB, and Amazon Aurora MySQL via SSL\/TLS<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/mysql\/flexible-server\/how-to-connect-tls-ssl\">Connect to Azure Database for MySQL &#8211; Flexible Server with encrypted connections<\/a><\/li>\n<\/ul>\n\n\n\n<p> <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u672c\u6211\u4e00\u76f4\u662f\u4f7f\u7528\u5404\u4e2aYUM\u4ed3\u5e93\u4e2d\u9ed8\u8ba4\u7684sysbench\u7248\u672c\u7684\uff0c\u4e3b\u8981\u662f\u8003\u8651\u5b89\u88c5\u90e8\u7f72\u65b9\u4fbf\uff0c\u800c\u4e00\u76f4\u4ee5\u6765\u8fd9\u4e2a\u7248\u672c\u4f3c\u4e4e\u90fd\u6ca1\u6709\u9047\u5230\u4ec0\u4e48\u95ee\u9898\uff0c\u76f4\u5230&#8230;\u5c1d\u8bd5\u81ea\u52a8\u5316\u7684\u5bf9Azure\u4e0a\u7684MySQL\u8fdb\u884c\u538b\u6d4b\u3002 \u9ed8\u8ba4\u7684sysbench\u7248\u672c\u662f1.0.17\u7248\uff08Mar 15, 2019\uff09\uff0c\u9996\u5148\uff0c\u662f\u9047\u5230\u4e86\u5982\u4e0b\u7684\u62a5\u9519\u4fe1\u606f\uff1a \u5728\u8be5\u7248\u672c\u4e2d\uff0csysbench\u63d0\u4f9b\u4e86\u53c2\u6570&#8211;mysql-ssl=[on|off]\u4ee5\u5c1d\u8bd5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u4f46\u5bf9\u4e8e\u6700\u65b0\u7248\u672c\u7684MySQL\uff0c\u8be5\u53c2\u6570\u5f88\u591a\u65f6\u5019\u90fd\u65e0\u6cd5\u6b63\u5e38\u5de5\u4f5c\uff0c\u5982\u679c\u4f60\u4e5f\u5c1d\u8bd5\u4e86\u8be5\u53c2\u6570\uff0c\u90a3\u4e48\u4f1a\u62a5\u5982\u4e0b\u9519\u8bef\uff1a \u5982\u679c\uff0c\u6070\u597d\uff0c\u4f60\u6ce8\u610f\u4e0a\u9762\u7684\u62a5\u9519\u53ef\u80fd\u662fCA\u8bc1\u4e66\u7684\u95ee\u9898\uff0c\u4e8e\u662f\u4f60\u4e5f\u50cf\u6211\u4e00\u6837\u5c1d\u8bd5\u901a\u8fc7 \u4e0b\u8f7d\u8bc1\u4e66\u7684\u65b9\u5f0f\u53bb\u89e3\u51b3\uff0c\u5e76\u901a\u8fc7GitHub\u4e0a\u7684issue\uff0c\u6210\u529f\u5c06CA\u8bc1\u4e66\u6539\u540d\u6210cacert.pem\uff0c\u5e76\u653e\u5728\u5f53\u524d\u7684\u8def\u5f84\u4e0b\uff0c\u90a3\u4e48\u4f60\u8fd8\u4f1a\u9047\u5230\u5982\u4e0b\u62a5\u9519\uff1a \u597d\u4e86\uff0c\u4e5f\u8bb8\u4f60\u518d\u6210\u529f\u751f\u6210client-cert.pem\u3001client-key.pem\u7684\u8bdd\uff0c\u4e5f\u8bb8\u4f60\u771f\u7684\u80fd\u591f\u8fd0\u884c\u6210\u529f\u3002\u4e0d\u8fc7\uff0c\u518d\u5411\u540e\uff0c\u6211\u5c31\u6ca1\u6709\u5c1d\u8bd5\u4e86\uff0c\u539f\u56e0\u662f\uff0c\u5982\u679c\u6bcf\u4e00\u6b21\u6d4b\u8bd5\u90fd\u53bb\u83b7\u5f97\u5404\u4e00\u4e2a\u8eab\u4efd\u8ba4\u8bc1\u7684\u5bc6\u94a5\u5bf9\uff0c\u90a3\u4e48\u5b9e\u5728\u662f\u592a\u590d\u6742\u4e86\u3002 \u6700\u7ec8\uff0c\u6211\u6839\u636eAWS\u4e0a\u8fd9\u7bc7\u6587\u7ae0\uff08Running sysbench on RDS MySQL&#8230; via SSL\/TLS\uff09\u7684\u5efa\u8bae\uff0c\u5c1d\u8bd5\u81ea\u5df1\u7f16\u8bd1\u5b89\u88c5\u4e86\u6700\u65b0\u7248\u672c\u7684sysbench\uff0c\u4e5f\u5c31\u662f1.1.0\u7248\u672c\u3002\u7136\u540e\u7b80\u5355\u7684\u4f7f\u7528\u53c2\u6570&#8211;mysql-ssl=preferred\u6216&#8211;mysql-ssl=required\u5f7b\u5e95\u7684\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\u3002 \u53c2\u8003\u6587\u6863<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[6],"tags":[],"class_list":["post-11553","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/11553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=11553"}],"version-history":[{"count":3,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/11553\/revisions"}],"predecessor-version":[{"id":11556,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/11553\/revisions\/11556"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=11553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=11553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=11553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}