Repository navigation
Conversation
cpu
left a comment
There was a problem hiding this comment.
Thanks! I have some doc nits for consideration but the mechanics look good.
| /// This sets `config.key_log` to a `KeyLogFile` which writes | ||
| /// to the path in the `SSLKEYLOGFILE` env var (if set). If the variable is | ||
| /// not set, it becomes a no-op. |
There was a problem hiding this comment.
I think this is true for with_key_log_file(), but not for with_key_log() right? There's probably enough explanation on with_key_log_file() to remove this bit to avoid confusion.
| } | ||
| } | ||
|
|
||
| /// Methods for enabling TLS key logging on a `ClientConfig`. |
There was a problem hiding this comment.
I'd be tempted to put a warning after this headline similar to the one the Rusts docs have for KeyLog to emphasize this should be used carefully:
Secrets passed over the interface are extremely sensitive and can break the security of past, present and future sessions.
| fn with_key_log(self, key_log: Arc<dyn KeyLog>) -> Self; | ||
|
|
||
| // Enable NSS-style key logging to the file named by `SSLKEYLOGFILE`. | ||
| /// |
There was a problem hiding this comment.
Maybe worth using the word "replace" somewhere here similar to the other fn to emphasize if you call with_key_log(...) and then with_key_log_file(...) it isn't setting up both, it's stomping the first.
|
I'm not sure this is worth doing? It seems like this would be easy enough to do using existing API, and I'm not sure how easy we want to make this? |
|
I understand where you're coming from but I feel like people building products that use TLS should have ergonomic access to the available APIs that let them debug their programs. I saw in the issue thread that you'd accept a PR so I opened one. I can see myself using this as I continue to open PRs for |
|
Let's see what the other maintainers think... |
|
I feel like the the ergonomic builder-style API should be limited to things that we expect all users to make a decision on, and the less ergonomic and less discoverable setting-fields-on- In general I don't really want to put the keylog/SSLKEYLOGFILE stuff too far "forward" in the API. I've even been considering gating/defanging |
Yeah, my thinking has evolved since then. Sorry for turning down your PR! |
|
Hey, no problem, I'm here to make things better, not worse! Thanks for the review and information. |
This addresses #286
It extends
rustls::ClientConfigwith aClientConfigKeyLogExtto allow settingkey_logon theClientConfigas part of the builder pattern.This seemed useful and looked like an easy addition so here it is. Writing a unit test seemed like more overhead than it was worth so I left it out but if you'd like a test just let me know.
Thanks!