google / google/conscrypt

Feature Request: common approach to error taxonomies

Open
#922 4 comments 0 reactions 0 assignees View on GitHub
enhancement needs more info
Dominant language
Java
Stars
1.4k
Forks
326
Avg merge
16h 22m
Merged PRs (30d)
17

Description

Follup from this request to us https://github.com/square/okhttp/issues/6413

It would be great if Conscrypt (and eventually Android) allowed some form of Exception -> code for error mapping.

https://www.w3.org/TR/network-error-logging/#predefined-network-error-types

It's tough for us to do something like this in OkHttp because each provider has it's own errors. So we would end up with maintenance of observable Conscrypt heuristics like for checking whether the certs provided were just not in the local CA store, or expired, or invalid?

```
try {
sslSocket.startHandshake()
} catch (s: SSLHandshakeException) {
val r = generateSequence(s) { it.cause }.find { it is CertPathValidatorException } as? CertPathValidatorException

if (r != null) {
println(r.certPath.certificates.map { (it as X509Certificate).subjectDN })
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.