Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException reloading https truststore #45723

Closed
shawkins opened this issue Jan 20, 2025 · 3 comments
Closed

ClassCastException reloading https truststore #45723

shawkins opened this issue Jan 20, 2025 · 3 comments
Labels
area/vertx kind/bug Something isn't working triage/duplicate This issue or pull request already exists

Comments

@shawkins
Copy link
Contributor

Describe the bug

With reload enabled a class cast exception will be seen if the configurion sets a pkcs12 truststore and an https key / cert files.

See keycloak/keycloak#36584

Expected behavior

The reload should work.

Actual behavior

At the reload interval, we see:

2025-01-18 10:59:21,551 ERROR [io.quarkus.vertx.http.runtime.options.TlsCertificateReloader] (vert.x-eventloop-thread-15) Unable to reload the TLS certificate, keeping the current one.: java.lang.ClassCastException: class io.vertx.core.net.PemKeyCertOptions cannot be cast to class io.vertx.core.net.KeyStoreOptions (io.vertx.core.net.PemKeyCertOptions and io.vertx.core.net.KeyStoreOptions are in unnamed module of loader io.quarkus.bootstrap.runner.RunnerClassLoader @6e5e91e4)
        at io.quarkus.vertx.http.runtime.options.TlsCertificateReloader.reloadFileContent(TlsCertificateReloader.java:215)
        at io.quarkus.vertx.http.runtime.options.TlsCertificateReloader$1$3.call(TlsCertificateReloader.java:109)
        at io.quarkus.vertx.http.runtime.options.TlsCertificateReloader$1$3.call(TlsCertificateReloader.java:99)
        at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$0(ContextImpl.java:178)
        at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:270)
        at io.vertx.core.impl.ContextImpl.lambda$internalExecuteBlocking$2(ContextImpl.java:210)
        at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
        at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:635)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1495)
        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
        at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:1575)

How to Reproduce?

This will happen with a configuration like:

quarkus.http.ssl.certificate.reload-period=1m
quarkus.http.ssl.certificate.trust-store-file=trust.p12
quarkus.http.ssl.certificate.trust-store-password=password
quarkus.http.ssl.certificate.files=cert
quarkus.http.ssl.certificate.key-files=key

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.15.1

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

No response

Additional information

No response

@geoand
Copy link
Contributor

geoand commented Jan 20, 2025

This looks like a duplicate of #45565, no?

@shawkins
Copy link
Contributor Author

@geoand, yes that issue should address this as referencing the truststore config there is the proper behavior. Since that issue made no mention of a potenial class cast exception, I missed the correlation.

@geoand
Copy link
Contributor

geoand commented Jan 20, 2025

No problem!

@geoand geoand closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2025
@geoand geoand added the triage/duplicate This issue or pull request already exists label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vertx kind/bug Something isn't working triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants