Closed cBournhonesque closed 7 months ago
I would like to second this, although I agree with @BiagioFesta that we should not reveal private keys in the process.
My use case is that I have other structs that I wish to derive(Debug) on, and therefore I need all types to implement Debug. I had to wrap it myself, which turned out to be a bit of a hassle. Its also useful for debuggers - many debuggers will use the Debug
implementation to display the contents of the variable.
I actually think it might be wise to do this for almost every exported type. For example, I have similar problems with BiStream
- it means that my types that hold a Framed
don't implement Debug, and I had to write lots of boilerplate to wrap it.
Yes, my usecase is that I have some structs that I want to derive Debug on that contain a certificate. I guess a better solution is to have a custom Debug implementation.
I opened https://github.com/BiagioFesta/wtransport/pull/146
That PR has a bigger scope as it makes a refactoring of the TLS design module. However, it should also fix the Debug
issue. The new main object, that is, Identity
implements Debug
without leaking the private key.
Lemme know if works for you. Thanks
I actually think it might be wise to do this for almost every exported type. For example, I have similar problems with BiStream - it means that my types that hold a Framed don't implement Debug, and I had to write lots of boilerplate to wrap it.
I completely agree. In general, it's totally ok to implement Debug
for wtransport
types. If some misses that, please open PR or an issue,
For BiStream
: https://github.com/BiagioFesta/wtransport/commit/de61e40d86cdabd5c1da319e35303c03e7d77e99
I am going to close this PR as superseded by https://github.com/BiagioFesta/wtransport/pull/146
Debug
is now provided for all TLS types without leaking private key
This would be useful because I have a Certificate inside some structs that I would like to implement Debug for