Saturday, September 14, 2019

Tutorial: Generate an SSL certificate - OpenSSL

Hello everyone, this is the Termux hacker of the whole team, IRISnoir. Do you miss me? If you do, I’m here with ya. If you don’t, then you’re an asshole (just kidding). Anyways, I’m back with another tutorial for our site. This time, it’s about how to generate an SSL certificate. No more of the bullcrap, let’s bounce!

Now, what you will need is:
openssl-tool to generate the SSL cert (Captain Obvious)
And that’s about it.

Now, an SSL certificate is used for website security. Now what it does is it will encrypt each and every last bits of any connections you make to the server. This includes your login credentials, clicked links and many more.

Fun fact: The URL is originally HTTP. But activating SSL will turn it to HTTPS. That is the sign that your connection is secure.

Now, the command to generate your certificate and private key is:
openssl req -x509 -newkey rsa:7403 -keyout certkey.pem -out cert.pem -days 365 -verify -set_serial 740340178739478 -sha512

It’s the command that I crafted. You just need to execute it. Then be patient while it auto crafts your cert and key. It has come to my attention that it will take shorter time if you exit Termux and go do other stuff like watching Youtube. After 2 or 3 videos, you can go back to Termux.

Now, you just need to answer all the questions it asks you. It’s really easy. When you’re done, check the current directory. If you see two new files: cert.pem and certkey.pem. Then, you’re doing it right.

To check if the certificate and private key works, use this command:
openssl s_server -key certkey.pem -cert cert.pem -accept 44330 -www
This command will attempt to establish a connection. Now, just go to your browser and connect to: https://localhost:44330

When you try to connect, your browser will warn you about some kind of ‘Security error’. But I assure you that nothing is to worry about. You’re actually on the right path.

The reason it says this is because the certificate is self-signed. It means that it is freely generated with something like OpenSSL. You don’t have to worry as there’s nothing for hackers to steal here.

Just continue with Advanced – Continue connecting to localhost

And there you go. If you see some info appearing, congratz. It is working fine and dandy.

Usage: It can be used with Apache2, and basically any other web servers that supports SSL. You just need some configuring and you’re good to go.

This is the end of the tutorial. If you enjoyed, please share it with your friends and also donate to us. It would mean a LOT. Have a nice day. And remember, stay safe, stay ethical.


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.