Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔒 Feature Request - Automatic SSL certs with mkcert #309

Open
the0neyouseek opened this issue Jun 30, 2018 · 5 comments
Open

🔒 Feature Request - Automatic SSL certs with mkcert #309

the0neyouseek opened this issue Jun 30, 2018 · 5 comments

Comments

@the0neyouseek
Copy link
Contributor

Hi @typicode !

First and foremost, thanks for the useful tool. I use it almost every day at work and it's been amazingly great so far, kudos 🙏 !

Would it be possible to integrate something such as @FiloSottile/mkcert to have automatic ssl certs generated when we add or remove a server ?

I've done it manually (replacing cert.pem and key.pem in the .hotel dir with the mkcert generated ones) and it's working perfectly but I would prefer for it to be automated/built in…

Thanks and have a nice day !

@the0neyouseek the0neyouseek changed the title 🔒 Feature Request - Automatic SSL certs with mkcert 🔒 Feature Request - Automatic SSL certs with mkcert Jun 30, 2018
@layerssss
Copy link
Contributor

@the0neyouseek Hi, this feature came into my mind 2 years ago. And I remember it was also mentioned in other quite a few issues as well. That was why I started this alternative tool and started using it since.

https://github.com/layerssss/localhostd

It has gone through my own trial and fixes these 2 years and had a few additional features including trustable SSL built in. So I'm now inviting everyone to try it as well.

image
Screen Shot 2019-06-20 at 3 58 58 PM

@shreyasminocha
Copy link

@the0neyouseek

I've done it manually (replacing cert.pem and key.pem in the .hotel dir with the mkcert generated ones)

Which names did you use when creating the cert with mkcert? I tried *.localhost, but that doesn't work, since wildcards on TLDs aren't supported.

@the0neyouseek
Copy link
Contributor Author

@shreyasminocha Here's the command I've used :
mkcert localhost 127.0.0.1 hotel.localhost <name-of-project>.localhost followed by any domain where I need ssl.

It's a bit of cumbersome process to do this manually and I would prefer it if hotel generated the cert itself on every domain creation/removal but it works.

@shreyasminocha
Copy link

@the0neyouseek Thanks! I thought there was some shorthand that worked with all .localhost domains.

It's a bit of cumbersome process to do this manually and I would prefer it if hotel generated the cert itself on every domain creation/removal but it works.

Agreed.

@shreyasminocha
Copy link

shreyasminocha commented Apr 16, 2020

Here's a one-liner that works for me:

ls ~/.hotel/servers | sed -E 's/\.json/.localhost/g' | tr '\n' ' ' | xargs mkcert -key-file ~/.hotel/key.pem -cert-file ~/.hotel/cert.pem 'localhost' '127.0.0.1' '0.0.0.0' 'hotel.localhost'

One could potentially hook this up to some filesystem watcher and run it each time new files are added to ~/.hotel/servers. Kinda hacky, but works 🤷‍♂️.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants