-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend Envoy cert validator to use platform provided APIs #2144
Comments
What is |
I'm guessing If it is, that's great, but maybe the name is a bit misleading. If not, we do need a key that the EngineBuilder can write into config for that. To elaborate, for these bridged extensions with platform implementations, the API calls are mapped to function pointers which have per-platform definitions mapping them to actual platform calls. The Envoy internals are agnostic of the platform, so these connections are made at runtime during Engine configuration, and the mapped API is assigned a lookup key. During initialization, the Engine creates the call paths, registers the runtime API under the key, and then writes the key into config so the extension can retrieve it by name. |
I'm not a huge fan of the idea of a configuration bit that must be provided, and that there's only one correct value for on a given platform. That just screams "compile-time constant" to me. But I may not be understanding all the details; if so, ignore me and proceed. |
Yes, it is the key used to register the runtime API. |
That's a good point! In #2525, I removed |
For this use case, I think hardcoding is fine, especially given that there will only ever be one implementation in use per Envoy Engine. The name can just be baked into the registration of the API on the EM side. |
Description: add engine API to allow user config to use Android cert validation APIs. Risk Level: high Testing: added tests in Http2TestServerTest.java Docs Changes: Release Notes: Fixes envoyproxy#1575 Part of envoyproxy#2144 Signed-off-by: danzh <[email protected]>
Platform cert validators are now available for iOS and Android. |
Cert validator is extendable in upstream Envoy. As platforms such as Android and iOS provide their own cert validation APIs, E-M should use these platform provided APIs instead of, as the default cert validator does in upstream Envoy, calling into boring SSL on its own.
The plan for Android is documented in #1575. As we are designing the Android implementation with External::Api, which can be used for iOS extension in the future, we need to decide how to config the non-Android platform to still use the upstream Envoy's default cert validator in the transition period.
The Android config would look like:
with an Android specific ${platform_specific_key}.
For other platforms, before they switch to use the platform provided cert validator, they should be able to use the current transport socket config with
trusted_ca
orca_certificate_provider_instance
and withoutcustom_validator_config
. So their config looks likea)
To do so, the config pipeline need to generate transport socket config differently for Android and non-Andoid platforms.
b) The other option is to use the same custom_validator_config with a different ${platform_specific_key}, so their config pipeline will be the same. But as they haven't switched to using the platform provided APIs, their platform code should call into Envoy default cert validator.
We can gather thoughts here about which direction to take. IMO if a) is feasible, we should avoid b) as it causes extra layer of indirection from native code to platform and then back to native and the indirection will only be used in transition period.
The text was updated successfully, but these errors were encountered: