SSL for localhost takes 5 seconds now.
Tags: webdev, nginx, ssl, https
Published: 2024-05-28 07:54:08

Update on 2024/06/10: Thanks to your great support, it's been downloaded for more than 2,000 times! And we're pleased to announce that it's live on ProductHunt, please visit and support the product! 
https://www.producthunt.com/posts/ophiuchi

---

Update on 2024/06/02: We're happy to share with you that we've decided to open-source our application. Please check it out here and feel free to contribute if you wish: 
https://github.com/apilylabs/ophiuchi-desktop


---

Why would anyone need to setup ssl for a localhost development?

- Test your web application in a secure environment.
- Some OAuth providers require ssl (like Google).
- Test and find out if there are potential security risks (mixed content) in your application.
- You need to work with CORS and cookies before you deploy your application.
- Test service workers in a secure environment.
- Test web push notifications in a secure environment.

As developers, we’ve all been there.  
There is the hard way, and there is the easy way. 
If you search the web and what you'll only find is the hard way.

The seemingly simple task of setting up SSL for localhost can surprisingly turn into a multi-hour ordeal, tangled in manual configurations (of which never works first time) and repetitive steps.

###The Hard (Manual and Tedious) SSL Setup on Localhost

Setting up SSL for localhost traditionally involves a series of tedious steps:

**Generating a Self-Signed Certificate:** Initially, you need to manually create a certificate that browsers will inevitably mistrust, just to get started.

**Editing the /etc/hosts File:** Next, you dive into system files like /etc/hosts to map your desired domain name, such as local.whatever, to 127.0.0.1. This usually requires command line tools like vi or nano, which not everyone is comfortable using.

**Launching a Web Server Locally:** Whether it’s Apache, Nginx, or another, you need to download and set up a web server on your machine. (Which I'm not a fan of, because they may mess up my computer)

**Configuring the Web Server:** This involves tweaking server configuration files to recognize your new hostname and certificate, often requiring you to dig through documentation to get syntax and paths right.

**Trusting the Certificate:** Lastly, you must convince your computer to trust the certificate you generated, which often involves several more obscure commands or diving into keychain access nonsense.

This process isn’t just cumbersome — it’s a repeat performance **“every time”** you start a new project or want to test something quickly.

But now, it can be done in 5 seconds. 

###Introducing Ophiuchi: Localhost SSL Proxy Made Simple

Now, imagine a tool that condenses all these steps into a quick, seamless operation. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/142or0wk768jq5ygcgl9.png)

With Ophiuchi, the entire process of setting up SSL for your localhost projects is reduced to a few types and clicks. 



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12jdugzgqk61gig10246.png)


Here’s how it simplifies each step:

**Automatic Certificate Generation:** Ophiuchi handles the creation of self-signed certificates automatically for specified domain name. No command line necessary. No hassle.

**Domain Mapping:** Ophiuchi automatically updates your /etc/hosts file with any domain name of your choice, mapping it directly to your localhost environment.

**Integrated Web Server:** Forget about downloading and configuring a separate web server; Ophiuchi comes with an integrated solution that’s pre-configured to use your SSL settings right out of the box. (Docker is required. But most developers use docker naturally for other stuff.)

**Instant Trust:** Ophiuchi includes a feature to automatically add the certificate to your system’s trusted list, bypassing those annoying browser warnings about untrusted certificates.

**Deleting is EZ:** When you’re done using the proxy server and you want to delete it? Above workflow is just reversed!

**It’s Also Secure:** Everything (certs, config files) never leaves your computer, never shared via network.


--- 

###Why Waste Time?

Time is precious. Why should something as fundamental as testing over HTTPS be a roadblock in your development workflow? With Ophiuchi, it isn’t anymore. This tool is designed for developers by developers, understanding that your time is best spent on creating, not configuring.

Whether you’re working on a personal project or testing enterprise-level applications, Ophiuchi ensures that your shift from HTTP to HTTPS on localhost is as smooth and swift as a few clicks. What used to take hours now takes seconds, freeing you up to focus on what really matters: building great software.

I have to mention it’s still alpha. But I use it every now and then. My teammates also use Ophiuchi a lot and they became happier than ever!

Why not give it a try?

https://www.ophiuchi.dev

---

# Edit: 

I (the author) am the creator of this application. 

As mentioned in the comments, I understand that security risk is a priority for native desktop apps. All versions of this app is/will be Notarized by Apple for extra security. Next update will include an alternative way for users to manually copy & paste into the terminal for extra safety option! 

There is a twitter account you can look at and a discord channel you can freely join if you have any questions! 😃


(Twitter)[https://x.com/get_ophiuchi]

(Discord)[https://discord.gg/fpp8kNyPtz]