Hack Forums
How to add self signed SSL certification? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Computing (https://hackforums.net/forumdisplay.php?fid=88)
+---- Forum: Linux (https://hackforums.net/forumdisplay.php?fid=85)
+---- Thread: How to add self signed SSL certification? (/showthread.php?tid=5950809)



How to add self signed SSL certification? - hack3rcon - Mar 15, 2019

Hello.
How can I add my own SSL certification to Apache?

Thank you.


RE: How to add self signed SSL certification? - G3ph4z - Mar 15, 2019

(Mar 15, 2019 06:38 AM)hack3rcon Wrote:  Hello.
How can I add my own SSL certification to Apache?

Thank you.

Just add these lines to your virtualhost config:
Code
SSLEngine on
SSLCertificateFile /etc/ssl/crt/primary.crt
SSLCertificateKeyFile /etc/ssl/crt/private.key
SSLCertificateChainFile /etc/ssl/crt/intermediate.crt

I am not sure is this necessary nowadays, but I think no. Anyways, if you get error about missing ssl engine, then use this.
If you don't enabled yet ssl module, then use this command before restart:
Code
sudo a2enmod ssl


and then you can restart your apache:
Code
sudo systemctl restart apache2



RE: How to add self signed SSL certification? - hack3rcon - Mar 15, 2019

(Mar 15, 2019 07:08 AM)G3ph4z Wrote:  Just add these lines to your virtualhost config:
Code
SSLEngine on
SSLCertificateFile /etc/ssl/crt/primary.crt
SSLCertificateKeyFile /etc/ssl/crt/private.key
SSLCertificateChainFile /etc/ssl/crt/intermediate.crt

I am not sure is this necessary nowadays, but I think no. Anyways, if you get error about missing ssl engine, then use this.
If you don't enabled yet ssl module, then use this command before restart:
Code
sudo a2enmod ssl


and then you can restart your apache:
Code
sudo systemctl restart apache2

I generated my own keys via below commands:
Code
# openssl genrsa -des3 -out "Website".key 1024
# openssl req -new -key "Website".key -out exmaple.csr
# openssl x509 -req -days 365 -in "Website".csr -signkey "Website".key -out "Website".com.crt
But when I want to browse my website then it show me "Your connection is not private".


RE: How to add self signed SSL certification? - SuckySucky - Mar 16, 2019

why are you using a self-signed certificate ?

https://letsencrypt.org


RE: How to add self signed SSL certification? - BTC - Mar 16, 2019

(Mar 16, 2019 02:45 AM)SuckySucky Wrote:  why are you using a self-signed certificate ?

https://letsencrypt.org

Agreed. You should be using letsenrypt.


RE: How to add self signed SSL certification? - Betty Blue - Mar 16, 2019

(Mar 15, 2019 11:49 PM)hack3rcon Wrote:  I generated my own keys via below commands:
Code
# openssl genrsa -des3 -out "Website".key 1024
# openssl req -new -key "Website".key -out exmaple.csr
# openssl x509 -req -days 365 -in "Website".csr -signkey "Website".key -out "Website".com.crt
But when I want to browse my website then it show me "Your connection is not private".
Did you do anything that he said? lol