Redis URLs provided by Qovery as env vars start with redis://, the correct one needs to start with rediss:// (SSL connection) for the generated managed instances (haven’t tested container ones).
Qovery team please fix the Redis URL env var protocol
Hi @bchastanier, we use an ElastiCache Redis 6 cluster (provisioned on the Qovery console). We connect to it using ioredis v5 on Node.js, and redis v4 on Python.
Given that Qovery provides an env var DATABASE_URL_INTERNAL, we expected to be able to connect to it using it without modifications, however, since the cluster only seems to accept SSL connections, this wasn’t possible.
Using the Qovery internal hostname fails with a TLS error using ioredis v5 on Node.js:
Unhandled error event: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate’s altnames: Host: [QOVERY_INTERNAL_HOSTNAME]. is not in the cert’s altnames: DNS:*.[QOVERY_INTERNAL_HOSTNAME].xxx.use1.cache.amazonaws.com
Do you mind sharing the link to your environment so I can have a look?
The workaround I am think of as of now is:
Use variable interpolation Qovery side by creating a new var like QOVERY_REDIS_SSL_URL with a value of rediss://:{{ QOVERY_REDIS_ZXX.._LOGIN }}:{{ QOVERY_REDIS_ZXX.._PASSWORD }}@{{ QOVERY__REDIS_ZXX.._HOSTNAME }}: {{ REDIS_ZXX.._PORT }}/0
Using the public cluster HOST exposed should prevent having you needed the cluster hostname from error message.
Yes, I tried that, unfortunately I got the same error message that @s.aranguiz reported:
Unhandled error event: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate’s altnames: Host: [QOVERY_INTERNAL_HOSTNAME]. is not in the cert’s altnames: DNS:*.[QOVERY_INTERNAL_HOSTNAME].xxx.use1.cache.amazonaws.com
I tried to connect to redis with both of your suggestions, but no luck
With the interpolation suggesstion, I get a “connection closed” error (so it seems it just cannot connect to redis this way) and without TLS, the connection is also rejected.
Thanks for the update! I’ve just re-created the Redis instance, and now no additional option like tls.rejectUnauthorized is necessary with ioredis as the URL has rediss:// as its protocol.
Everything just works!