{"id":34,"date":"2022-05-16T05:45:35","date_gmt":"2022-05-16T05:45:35","guid":{"rendered":"https:\/\/me.where.com.vn\/?p=34"},"modified":"2022-05-16T05:45:35","modified_gmt":"2022-05-16T05:45:35","slug":"locally-trusted-development-certificates","status":"publish","type":"post","link":"https:\/\/me.where.com.vn\/?p=34","title":{"rendered":"Locally-trusted development certificates"},"content":{"rendered":"\n<p>Sometime, you need to run your local development work as a trusted site. <strong>mkcert<\/strong> will help to make your life easier.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Install<\/span><\/strong> (use Chocolatey): <code>choco install mkcert<\/code><\/p>\n\n\n\n<p>or download from this link <a href=\"https:\/\/github.com\/FiloSottile\/mkcert\/releases\">https:\/\/github.com\/FiloSottile\/mkcert\/releases<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Commands<\/span><\/strong>:<\/p>\n\n\n\n<ul><li><code>mkcert -install<\/code><br><em>Install the local CA in the system trust store<\/em><\/li><li><code>mkcert example.com myapp.dev localhost 127.0.0.1 ::1<\/code><br><em>Generate &#8220;example.com+4.pem&#8221; and &#8220;example.com+4-key.pem&#8221;<\/em><\/li><\/ul>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Example usage<\/span><\/strong>:<\/p>\n\n\n\n<p>With the key files generated, you can use it in <strong>nginx<\/strong> config as below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        listen       443 ssl;\r\n        server_name  <em>example.com<\/em>;\r\n\r\n        ssl_certificate      c:\/&lt;path>\/<em>example.com+4<\/em>.pem;\r\n        ssl_certificate_key  c:\/&lt;path>\/<em>example.com+4-key<\/em>.pem;\r\n\r\n        ssl_session_cache    shared:SSL:1m;\r\n        ssl_session_timeout  5m;\r\n\r\n        ssl_ciphers  HIGH:!aNULL:!MD5;\r\n        ssl_prefer_server_ciphers  on;<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometime, you need to run your local development work as a trusted site. mkcert will help to make your life easier. Install (use Chocolatey):.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/me.where.com.vn\/index.php?rest_route=\/wp\/v2\/posts\/34"}],"collection":[{"href":"https:\/\/me.where.com.vn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/me.where.com.vn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/me.where.com.vn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/me.where.com.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=34"}],"version-history":[{"count":1,"href":"https:\/\/me.where.com.vn\/index.php?rest_route=\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":35,"href":"https:\/\/me.where.com.vn\/index.php?rest_route=\/wp\/v2\/posts\/34\/revisions\/35"}],"wp:attachment":[{"href":"https:\/\/me.where.com.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/me.where.com.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/me.where.com.vn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}