{"id":272,"date":"2012-06-15T16:53:14","date_gmt":"2012-06-15T08:53:14","guid":{"rendered":"http:\/\/rmohan.com\/?p=272"},"modified":"2012-06-15T16:53:54","modified_gmt":"2012-06-15T08:53:54","slug":"creating-a-self-signed-ssl-certificate","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=272","title":{"rendered":"Creating a self-signed SSL Certificate"},"content":{"rendered":"<p><strong>Creating a self-signed SSL Certificate<\/strong><\/p>\n<p>How to Enable SSL FOR YOUR OWN WEBSITE.<\/p>\n<p>For this you will need the openssl package.  First we want to start by generating a private key.<\/p>\n<p>    root@localhost# openssl genrsa -out www.rmohan.com.key 1024<br \/>\n    Generating RSA private key, 1024 bit long modulus<br \/>\n    \u2026\u2026\u2026\u2026.++++++<br \/>\n    \u2026\u2026\u2026\u2026\u2026\u2026..++++++<br \/>\n    e is 65537 (0\u00d710001)<\/p>\n<p>Then, we need to generate the certificate request and fill in the appropriate information.  Make sure that the \u201cCommon Name\u201d matches the domain you want to protect via SSL, so if you domain was www.rmohan.com, use that.  If you wanted to protect rmohan.com (without the www.) then use that.<\/p>\n<p>    root@localhost# openssl req -new -key www.rmohan.com.key -out www.rmohan.com.csr<br \/>\n    You are about to be asked to enter information that will be incorporated<br \/>\n    into your certificate request.<br \/>\n    What you are about to enter is what is called a Distinguished Name or a DN.<br \/>\n    There are quite a few fields but you can leave some blank<br \/>\n    For some fields there will be a default value,<br \/>\n    If you enter \u2018.\u2019, the field will be left blank.<br \/>\n    \u2014\u2013<br \/>\n    Country Name (2 letter code) [GB]:<br \/>\n    State or Province Name (full name) [Berkshire]:<br \/>\n    Locality Name (eg, city) [Newbury]:<br \/>\n    Organization Name (eg, company) [My Company Ltd]:<br \/>\n    Organizational Unit Name (eg, section) []:<br \/>\n    Common Name (eg, your name or your server\u2019s hostname) []:www.rmohan.com<br \/>\n    Email Address []:email@rmohan.com<\/p>\n<p>    Please enter the following \u2018extra\u2019 attributes<br \/>\n    to be sent with your certificate request<br \/>\n    A challenge password []:<br \/>\n    An optional company name []:<\/p>\n<p>Next, generate the self-signed certificate. You can specify the number of days the cert is valid for.<\/p>\n<p>    root@localhost# openssl x509 -req -days 365 -in www.rmohan.com.csr -signkey www.rmohan.com.key -out www.rmohan.com.crt<br \/>\n    Signature ok<br \/>\n    subject=\/C=\/ST=\/L=\/O=\/CN=www.rmohan.com\/emailAddress=email@rmohan.com<br \/>\n    Getting Private key<\/p>\n<p>Next, move the certificate and keyfile into apache\u2019s SSL directory.<\/p>\n<p>    mv www.rmohan.com.key \/etc\/httpd\/conf\/ssl.key\/<br \/>\n    mv www.rmohan.com.crt \/etc\/httpd\/conf\/ssl.crt\/<\/p>\n<p><VirtualHost 192.168.2.100:443><br \/>\nSSLEngine on<br \/>\nSSLCertificateFile \/etc\/httpd\/conf\/ssl.key\/www.rmohan.com.key<br \/>\nSSLCertificateKeyFile \/etc\/httpd\/conf\/ssl.crt\/www.rmohan.com.crt<br \/>\n<\/VirtualHost><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a self-signed SSL Certificate<\/p>\n<p>How to Enable SSL FOR YOUR OWN WEBSITE.<\/p>\n<p>For this you will need the openssl package. First we want to start by generating a private key.<\/p>\n<p> root@localhost# openssl genrsa -out www.rmohan.com.key 1024 Generating RSA private key, 1024 bit long modulus \u2026\u2026\u2026\u2026.++++++ \u2026\u2026\u2026\u2026\u2026\u2026..++++++ e is 65537 (0\u00d710001)<\/p>\n<p>Then, we need [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/272"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=272"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/272\/revisions"}],"predecessor-version":[{"id":274,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/272\/revisions\/274"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}