Running Discourse with SSL in Development

Hello,

I was looking if there was a solution but only topics that don’t provide help with this issue. I’m trying to get SSL running locally in Discourse. Looking at Rails tutorials to make this they recommend using the -b flag when running rails server, like.

rails s -b 'ssl://127.0.0.1:3000?key=config/ssl/localhost.key&cert=config/ssl/localhost.crt'

But this doesn’t work as expected in Discourse.

To generate the certificates I’m using https://github.com/FiloSottile/mkcert.

Any feedback would be appreciated.

Thanks!

Our team uses dedicated tools to test stuff that needs SSL (service workers, PWA, etc).

The most popular is https://ngrok.com/ but there are alternatives.

5 Likes

Thanks for the reply @Falco, I was looking to test SSO flows and using Ngrok will be an issue since we need to pass the approved callbacks to these services. I was expecting I can just bind the address to server with SSL through Rails. Any idea why this doesn’t work OTB?

Why would that be a problem? ngrok basic plan allows you to specify a custom subdomain.

Yeah I think that would require to change the callback URL on these services, for every developer that wants to do something with SSO, everytime ngrok is used