Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 3.5
Describe the issue:
We are configuring OpenSearch 3.5 to use OpenID authentication with Keycloak as the IdP. Our OpenSearch security configuration includes the following OpenID settings:
"authc": {
"openid_auth_domain": {
"http_enabled": true,
"order": 1,
"http_authenticator": {
"challenge": false,
"type": "openid",
"config": {
"subject_key": "preferred_username",
"roles_key": "roles",
"openid_connect_url": "https://ckey-ckey.xyz-ckey.svc.cluster.local:8443/access/realms/xyz-realm/.well-known/openid-configuration",
"openid_connect_idp": {
"enable_ssl": true,
"verify_hostnames": false,
"trust_all": false,
"pemtrustedcas_filepath": "/etc/opensearch/config/certs/keycloakRootCaPem"
}
}
}
}
}
Despite setting:
"verify_hostnames": false
OpenSearch still performs hostname verification and fails with the following error:
org.opensearch.security.auth.http.jwt.keybyoidc.AuthenticatorUnavailableException: Error while getting https://ckey-ckey.xyz-ckey.svc.cluster.local:8443/access/realms/xyz-realm/.well-known/openid-configuration: javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ckey-ckey.xyz-ckey.svc.cluster.local found
Stack trace shows failure originating from:
org.opensearch.security.auth.http.jwt.keybyoidc.KeySetRetriever org.opensearch.security.auth.http.jwt.keybyoidc.SelfRefreshingKeySet
Observed Behaviour:
OpenSearch attempts to validate hostname against certificate SAN even though:
verify_hostnames: false
is configured.
Expected Behaviour:
When:
verify_hostnames: false
is set, OpenSearch should skip hostname verification for the IdP TLS connection, similar to behavior in OpenSearch 2.x.
Observation:
This exact configuration works correctly in OpenSearch 2.x, where hostname verification is properly skipped when verify_hostnames is set to false.
The issue only appears in OpenSearch 3.x.
- Is this expected behavior in OpenSearch 3.x?
- Is this a known limitation or regression compared to OpenSearch 2.x?
- Is there any supported way to disable hostname verification for OpenID IdP connections in OpenSearch 3.x?
- Or is it mandatory that IdP certificate SAN must match the exact hostname?
Thanks!