Skip to content

Commit

Permalink
feat(relay): reloading certificate resolver (#2999)
Browse files Browse the repository at this point in the history
## Description

This sets us up so we can have manually/externally managed certs that
will reload on a daily basis. This should close
#1108 and we should follow up
on the ops side to utilize this where needed.

Ok, this turned out to be much grosser than expected. 
- I don't like the new dependencies we introduce
- I don't like the loader setup
- I'm unsure whether to keep the reloading resolver in the `iroh` repo
or move it into `tokio-rustls-acme` (think it should move over, but for
the sake of this discussion, included it here)
- Should I do anything with the `_handle` for the reloader in regards to
shutting down?

Most of this still feels necessary. I could maybe feature flag it?
I had a really hard time trying to extract the loader creation into a
standalone func which also aligns all the traits and error types so the
thing compiles.

Suggestions are welcome :)

Example config:
```
enable_relay = true
http_bind_addr = "[::]:80"
enable_stun = true
stun_bind_addr = "[::]:3478"
enable_metrics = true
metrics_addr = "127.0.0.1:9090"

[tls]
manual_cert_path="certificate.der"
manual_key_path="private_key.der"
cert_mode = "Reloading"
```

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
  • Loading branch information
Arqu authored Dec 12, 2024
1 parent e7503c0 commit c37895b
Show file tree
Hide file tree
Showing 6 changed files with 333 additions and 149 deletions.
Loading

0 comments on commit c37895b

Please sign in to comment.