You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
verification: enable ip subj. validation on android.
While the Android verifier defers to the platform verifier for most
certificate validation options, it relies on `webpki` for ensuring that
a certificate is valid for a given subject name. Since Webpki v0.100.x
it's been possible to use `webpki` to validate IP address subject names,
and so we want this capability to be enabled for the Android verifier.
This commit updates the Android `verifier` to accomplish this.
Additionally it enables the mock IP address subject test cases in the
mock test suite to ensure things work as expected.
In order to support this change the function signature of the inner
`Verifier.verify_certificate` fn has to change from accepting a `&str`
server name, to also accepting the `&rustls::ServerName` that the trait
based `ServerCertVerifier.verify_server_cert` was already accepting.
There are two main reasons for this:
1. If we try to pull out a `String` to pass forward from the
`rustls::ServerName::IpAddress(&IpAddr)` using `IpAddr.to_string()`
we'll get back a "compressed" address for IPv6 addresses. This is
problematic when later trying to convert to a `webpki::IpAddrRef` for
the validation call using `IpAddrRef::try_from_ascii_str`, because it
doesn't support the compressed form.
2. By passing through the `rustls::ServerName` directly we can defer the
actual process of interacting with `webpki` to the newly exposed
`rustls::client::verify_server_name` fn offered with the
`dangerous_configuration` feature. This will ensure the logic for
name validation is applied consistently between Rustls and the
platform verifier.
0 commit comments