quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

Redis error: Pool initialized with SSL but connection requested plain socket

Open jalonsomagnolia opened this issue 1 year ago • 9 comments

Describe the bug

Hello quarkus team!

We have an application configured for accessing a local Redis. The configuration is simple:

%quarkus.redis.hosts=redis://localhost:6379
%quarkus.redis.client-type=standalone

It works well when using Quarkus 3.11.3. However, it has started to fail after updating to the newer 3.12.0. Now we have this error:

Caused by: io.vertx.core.impl.NoStackTraceThrowable: Pool initialized with SSL but connection requested plain socket

Looking at the release notes, I see "Implementation of the internal TLS Registry". Could it be related? Indeed something has changed in this version.

Thanks in advance!

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

jalonsomagnolia avatar Jun 28 '24 11:06 jalonsomagnolia

/cc @Ladicek (redis), @cescoffier (redis), @machi1990 (redis)

quarkus-bot[bot] avatar Jun 28 '24 11:06 quarkus-bot[bot]

Anything configured under quarkus.tls?

cescoffier avatar Jun 28 '24 11:06 cescoffier

Thanks for the quick response. We haven't anything configured under quarkus.tls. I tried also with

quarkus.redis.tls.enabled=false

although I think it's the default value

jalonsomagnolia avatar Jun 28 '24 11:06 jalonsomagnolia

Sorry, I just saw we have

quarkus.tls.trust-all=true

Could it be a problem?

jalonsomagnolia avatar Jun 28 '24 11:06 jalonsomagnolia

In fact, after removing that configuration, it works again. Is this something expected?

jalonsomagnolia avatar Jun 28 '24 11:06 jalonsomagnolia

Not expected, sounds like a bug, but @cescoffier can provide more details

geoand avatar Jun 28 '24 13:06 geoand

It seems to me that before 6e1489c4deba694c743c88d8bff54de822dd530f quarkus.tls.trust-all only resulted in setting net.setTrustAll(); but now it also affects net.setSsl(), which seems wrong.

I can open a PR if you agree @cescoffier ?

geoand avatar Jun 28 '24 13:06 geoand

Ok, it's a bug. We need to be a bit more specific.

First TLS for redis is not enabled by default. Only if the host is rediss://.

Trust-all should not enable tls, if the scheme is not rediss://.

cescoffier avatar Jun 28 '24 13:06 cescoffier

Thanks for the quick response

jalonsomagnolia avatar Jun 28 '24 13:06 jalonsomagnolia