Files
swift-nio-extras/Sources
Franz Busch 145db1962f TimedCertificateReloader prevents non-self-signed certificates from b… (#274)
…eing loaded

Fix certificate check and make sure all code paths throw an error.

### Motivation:

TimedCertificateReloader currently has an invalid check that
accidecanlly enforces self-signed certificates. Additionally some code
paths of `reload()` did not throw an error which made it hard for the
call site to judge if the reloader was initialized successfully or not.
Further, the missing errors also meant that the `run()` method would
never be able to log these.

### Modifications:

* Updated the certificate check to validate the the public key of the
private key matches the cert's public key (instead of checking the
signature).
* Added three new error cases.

### Result:

* A caller can now be sure that their certificate and private key pair
are valid after calling `reload()` the first time.
* Errors in future reloads will be surfaced using the provided logger
and do not go unnoticed.
* You can actually use the reloader with normal certificates.
2025-05-30 12:31:14 +00:00
..
2025-01-14 11:24:08 +00:00
2025-01-14 11:24:08 +00:00