rustls / tokio-rustls

Async TLS for the Tokio runtime
Apache License 2.0
125 stars 70 forks source link

Detailed Error Messages #66

Closed Tahinli closed 7 months ago

Tahinli commented 7 months ago

Hi, I hope this time I'm in right place for right subject.

If problems can be analysed in much more precise way under the hood, please expose it to developer.

What I mean is, we get errors like bad certificate, unknown ca, etc. These are global errors I know, other languages and TLS systems also use them. But if you are able to give at least little details with these error messages for difference between same error messages but different problems, this would be cool.

Because there are a lot of situation can be combined in one error message and sometimes it's hard to find what is the exact reason of error.

For example in my situation, I got bad certificate error and I thought there is a problem with my server certificate, but no. Only problem is I should connect with domain address not the IP address in client side. It cost me couple of days, apparently this is because I'm not experienced enough.

If there is any chance to show errors in more detailed way, please add this feature. There are new learners like me out there.

ctz commented 7 months ago

What I mean is, we get errors like bad certificate, unknown ca, etc.

The errors you posted in the other issue were received alerts: they are the peer reporting an error. There is no place in the protocol to report further detailed information.

There are long-form description of the standard meaning of these in https://www.rfc-editor.org/rfc/rfc8446.html#section-6.2 (and other standards that define them, see IANA )

If you control the peer too, it would be more fruitful to get it to output logging. If your peer is also using rustls and enables env_logger, that would be setting the environment variable RUST_LOG=trace