webpki icon indicating copy to clipboard operation
webpki copied to clipboard

InvalidDNSNameError has no info about which name

Open Nokel81 opened this issue 4 years ago • 3 comments

When InvalidDNSNameError is returned there is no additional information about which DNS Name is invalid.

Nokel81 avatar Jan 14 '20 17:01 Nokel81

When InvalidDNSNameError is returned there is no additional information about which DNS Name is invalid.

Could you provide some example code that shows where InvalidDNSNameError occurs? AFAICT the only place it can happen is where your own code attempts to construct a DNSName, and in that case you know exactly what the input is.

briansmith avatar Mar 12 '20 16:03 briansmith

If I remember correctly this was because I was using tonic and hyper-rustls and they created a DNS name which should have been a URI but the error was coming from this package.

Nokel81 avatar Mar 12 '20 17:03 Nokel81

If I remember correctly this was because I was using tonic and hyper-rustls and they created a DNS name which should have been a URI but the error was coming from this package.

It is true that the design of InvalidDNSNameError makes it easy for those libraries to avoid reporting the name that was invalid. However, I'm not very eager to change it right now. Are there issues in the tonic and hyper-rustls repos about it?

briansmith avatar Mar 12 '20 17:03 briansmith