In a discussion titled “Running Discourse with SSL in Development,” eatcodetravel seeks help enabling SSL locally in Discourse using Rails’ -b flag with SSL binding, but finds it doesn’t work as expected. They’re using certificates generated via mkcert. Falco suggests using ngrok for SSL testing, commonly used by their team for features like service workers and PWAs. eatcodetravel replies that ngrok isn’t ideal for testing SSO flows, since it would require constantly updating callback URLs in external services for each developer’s ngrok tunnel. Falco counters that ngrok’s free plan allows custom subdomains, which could mitigate this. eatcodetravel clarifies that even with custom subdomains, it’s still cumbersome to update callback URLs across services for every developer using ngrok. The core issue remains: Discourse doesn’t support Rails’ built-in SSL binding out of the box, and the user seeks a local, developer-friendly SSL solution without external dependencies or service reconfiguration.
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'
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?
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