-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Closed
Copy link
Labels
Milestone
Description
Describe the bug
If certificate reloading is enabled with quarkus.http.ssl.certificate.reload-period
option, mTLS stop functioning after the reload even when the certificate file is not updated.
This is caused by mishandling of trustOptions here:
if (configuration.certificate.trustStoreFile.isPresent()) {
var opts = ((KeyStoreOptions) copy.getKeyCertOptions());
opts.setValue(Buffer.buffer(getFileContent(configuration.certificate.trustStoreFile.get())));
copy.setTrustOptions(opts);
}
the opts
value should be taken from copy.getTrustOptions()
but copy.getKeyCertOptions
.
Because of this mishandling, trust store config is overwritten by key store config.
Expected behavior
Even after the reload, mTLS should continue to work.
Actual behavior
mTLS stop functioning
How to Reproduce?
Reproducer:
- Setup quarkus to serve with mTLS
- Enable certificate reloading with
quarkus.http.ssl.certificate.reload-period=3m
option - Wait the certificate reload, and access the quarkus server with HTTPS.
- You will encounter TLS connection issue.
Quarkus version or git rev
3.17.6