You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The quarkus tls registry ignores some keystore properties that are in environment variables.
It can be triggered reliably when "a lot" of @ConfigMapping are present.
I could reproduce it since quarkus 3.17.0.
When injecting a smallrye-config @ConfigProperty corresponding to one of the tls registry config works as intended
Expected behavior
Environment variable should work to configure the tls registry.
If you comment some the inject configMappings, and restart, the app will work fine and the keystore will be loaded correcly.
--- a/src/main/java/com/test/scheduler/HelloController.java+++ b/src/main/java/com/test/scheduler/HelloController.java@@ -37,30 +37,30 @@ public class HelloController {
@Inject
Intermediate intermediate;
- @Inject- B b;- @Inject- C c;- @Inject- D d;- @Inject- E e;- @Inject- G g;- @Inject- H h;- @Inject- I i;- @Inject- J j;- @Inject- K k;- @Inject- L l;- @Inject- M m;- @Inject- N n;+// @Inject+// B b;+// @Inject+// C c;+// @Inject+// D d;+// @Inject+// E e;+// @Inject+// G g;+// @Inject+// H h;+// @Inject+// I i;+// @Inject+// J j;+// @Inject+// K k;+// @Inject+// L l;+// @Inject+// M m;+// @Inject+// N n;
@ConfigProperty(name = "quarkus.tls.mytls.key.store.p12.path")
String string;
To reduce work, we try to match only a single root to compare against the names of that particular root. This works fine if every root has a different prefix, but we have a root that is just quarkus. So quarkus.tls would both match quarkus and quarkus.tls. Adding more mappings changes the order in which they appear on the list, which explains why it works until a certain point.
Describe the bug
The quarkus tls registry ignores some keystore properties that are in environment variables.
It can be triggered reliably when "a lot" of
@ConfigMapping
are present.I could reproduce it since quarkus 3.17.0.
When injecting a smallrye-config
@ConfigProperty
corresponding to one of the tls registry config works as intendedExpected behavior
Environment variable should work to configure the tls registry.
Actual behavior
Environment variable are ignored.
How to Reproduce?
Reproducer available here https://github.com/Malandril/-quark-bug-tls
To reproduce export the following variables:
Then run the app:
./gradlew qD
If you query the endpoint
curl localhost:8080/test/hello
the keystore will be null, but the properties are wellloaded by quarkus.
Output:
If you comment some the inject configMappings, and restart, the app will work fine and the keystore will be loaded correcly.
Output of the endpoint after patch:
Quarkus version or git rev
3.17.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)gradle 8.11.1
Additional information
Using system properties to pass tls configuratin works as expected, i could only reproduce it with environment variables.
The text was updated successfully, but these errors were encountered: