Unable To Connect/Connection Refused due to https certificates

AI-generated summary

Users are experiencing connection issues with their Discourse installation on DigitalOcean, receiving a ‘Connection Refused’ error due to SSL certificate problems. GregoryMatthews initially followed the official guides for SSL setup but faced connectivity issues. codinghorror suggested testing with plain HTTP to isolate the problem. pfaffman recommended using Let’s Encrypt for easier SSL management. kirupa asked about disabling SSL in app.yml, which pfaffman confirmed. lucasbasquerotto highlighted the risk of exceeding Let’s Encrypt’s rate limit, advising to check logs via ./launcher logs app. BoyanXu provided a detailed checklist, including verifying app.yml settings, checking port configurations, and ensuring proper firewall and security group rules. Jack51 confirmed the issue was due to rate limit overuse and resolved it by temporarily disabling SSL and rebuilding. AshNazir inquired about reconnecting after the rate limit reset.

We successfully installed Discourse through DigitalOcean using the following guide:

discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub

Our DNS is fully propagated, and we also installed our SSL CERTS per the following guide:

When browsing to our Discourse installation via IP or domain name, we get the following message:

This site can’t be reached

XX.XX.XX.XX refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

What could be the problem?

Almost certainly a SSL problem. Try rebuilding with plain HTTP first to make sure everything is working before adding on the complexity of HTTPS.

Using let’s encrypt is an easy way to get ssl.

… thanks for your help.

I am running into this same issue, To rebuild with plain HTTP, does that require just commenting out the SSL template line in app.yml?

Yes, but browsers that have visited your site will refuse to connect. You really should use https.

For anyone that face it in the future, make sure to not exceed the rate limit of LetsEncrypt:

You can see if it was exceeded in the logs:

./launcher logs app

Me encontré exactamente con el mismo mensaje de Chrome.

En mi caso, había varias configuraciones incorrectas: algunas eran ajustes de Discourse y otras de la configuración del servidor de alojamiento. Publico aquí mi lista de verificación como referencia:

  1. Verifica /var/discourse/containers/app.yml

(Sigue esta publicación: Allow SSL / HTTPS for your Discourse Docker setup)

Asegúrate de permitir tanto HTTPS como HTTP (abre el puerto 443, descomenta la configuración de la plantilla relacionada con SSL y las configuraciones relacionadas con Let’s Encrypt) o solo solicitudes HTTP (bloquea el puerto 443, comenta la configuración de la plantilla relacionada con SSL y las configuraciones relacionadas con Let’s Encrypt).

Si se realizaron cambios en app.yml, ejecuta ./launcher rebuild app para activar las configuraciones actualizadas.

  1. Ejecuta ./launcher logs app.

Si fallas frecuentemente al reconstruir un servidor de Discourse funcional, como me pasó a mí, es posible que hayas solicitado demasiadas credenciales de Let’s Encrypt al mismo tiempo y hayas superado su límite.

Al ejecutar ./launcher logs app, se imprimirá un archivo json que incluye un error 429.

  1. Verifica la configuración de tu Security group para la instancia de tu servidor ECS

En mi caso, Security group es simplemente un conjunto de puertos permitidos (por ejemplo, 80 HTTP, 443 HTTPS), que te permiten controlar la comunicación de tu servidor con el exterior.

Asegúrate de permitir los puertos necesarios para alojar Discourse.

  1. Verifica la configuración del firewall

En mi caso, el paso 3 no abrió los puertos requeridos. Algo salió mal con la configuración de mi firewall.

Es extraño que nunca hubiera configurado el firewall de mi servidor, pero esos puertos sí se abrieron después de configurar:
apt install firewall-cmd
firewall-cmd --permanent --add-port=20-21/tcp (… y los demás puertos)
firewall-cmd --reload

Puedes verificar el estado de los puertos abiertos para tu dominio con algunos servicios en línea.

Yo también tuve este problema: excedí el límite de velocidad para certificados.

Lo solucioné siguiendo tu paso #1 (comentando las 2 plantillas SSL en app.yml) y abriendo el sitio en otro navegador una vez reconstruido.

Asumo que podré volver a habilitar SSL una vez que pase una semana.

¿Lograste conectarte después de que pasó una semana?