{"id":135,"date":"2008-05-17T15:04:51","date_gmt":"2008-05-17T12:04:51","guid":{"rendered":"http:\/\/patchlog.com\/?p=135"},"modified":"2008-05-17T15:06:21","modified_gmt":"2008-05-17T12:06:21","slug":"mysql-and-ssl","status":"publish","type":"post","link":"https:\/\/patchlog.com\/databases\/mysql-and-ssl\/","title":{"rendered":"MySQL and SSL"},"content":{"rendered":"<p>I have been setting up a few mysql servers with SSL support for replication .<\/p>\n<p>I used the script provided in the the official <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/secure-create-certs.html\" title=\"Setting Up SSL Certificates for MySQL\" >mysql documentation<\/a>\u00c2\u00a0 for creating the ssl certificates cause I needed to do it on more then one server and it made more sense to use it then actually creating each certificate one by one.<\/p>\n<p>If you just read the documentation and create the certificate one by one you will be fine but if you use the script your CA certificate will expire after 30 days and after a month you'll be banging your head trying to find out why suddenly SSL connections don't work anymore.<br \/>\nYou know your certificates should be valid for a year or more but why doesn't it work anymore ... running this command :<\/p>\n<pre><ol><li style=\"font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;\"><div style=\"font-family: 'Courier New', Courier, monospace; font-weight: normal;\">&nbsp;<\/div><\/li><\/ol><\/pre>\n<p>reveals it ...<\/p>\n<pre>notBefore=Apr 17 12:20:10 2008 GMT\r\nnotAfter=May 17 12:20:10 2008 GMT<\/pre>\n<p>Ah .... there you go ... just 30 days for the cacert file ... insane...<br \/>\nThe problem was actually reported by someone else in the comments on that documentation page but I was in a hurry ( yeah right ) and didn't go that far with reading it.<br \/>\nNote to self:  always read the comments on those pages<br \/>\nSo if you use that script make sure you modify it to make the CA valid for more then 30 days.<br \/>\nThis line: <\/p>\n<pre><ol><li style=\"font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;\"><div style=\"font-family: 'Courier New', Courier, monospace; font-weight: normal;\">&nbsp;<\/div><\/li><\/ol><\/pre>\n<p>Should be something like:<\/p>\n<pre><ol><li style=\"font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;\"><div style=\"font-family: 'Courier New', Courier, monospace; font-weight: normal;\">&nbsp;<\/div><\/li><\/ol><\/pre>\n<p>That is if you want the CA cert to be valid for a year. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been setting up a few mysql servers with SSL support for replication . I used the script provided in the the official mysql documentation\u00c2\u00a0 for creating the ssl certificates cause I needed to do it on more then one server and it made more sense to use it then actually creating each certificate &hellip; <a href=\"https:\/\/patchlog.com\/databases\/mysql-and-ssl\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">MySQL and SSL<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[173,21,174,172],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-databases","tag-certificates","tag-mysql","tag-openssl","tag-ssl"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pofPh-2b","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/comments?post=135"}],"version-history":[{"count":0,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"wp:attachment":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}