mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
TlsConfigSource is a MicroProfile ConfigSource, so it runs before CDI startup and before quarkus-security registers its runtime security providers. BouncyCastle was therefore not yet registered when the source checked whether the persisted certificate could be reused. isSelfSigned() calls CertificateGenerator.parseCertificate(), which failed with "no such provider: BC", so isSelfSigned() returned false and the self-signed certificate was needlessly regenerated on every restart. Register BouncyCastle at the top of the constructor (before any certificate parsing) by hoisting the existing inline registration in generateSelfSignedCert() into a shared ensureBouncyCastleRegistered() helper. The reuse check now parses the existing certificate successfully and keeps it across restarts.