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
Now that #84 is fixed (thank you @wood-push-melon!), the sssd operator can successfully pull the TLS certificates from glauth-k8s via the certificate_transfer interface. However, sssd still fails to connect to glauth because of a Common Name (CN) mismatch between the hostname that was used to generate the TLS certificate in the glauth-k8s unit and the ingress URL sssd is using to connect to glauth. The sssd service generates the following error logs when I try to start it up with ldap_tls_reqcert set to hard (default):
libldap: TLS: hostname (10.0.0.135) does not match common name in certificate (ldap.glauth.com).
libldap: TLS: can't connect: (unknown error code).
libldap: ldap_err2string
10.0.0.135 is the LoadBalancer IP used by Traefik, and ldap.glauth.com is the configured hostname for my deployed glauth-k8s unit. ldap_tls_reqcert = hard basically tells sssd to wig out and throw out errors if the TLS certificate provided by the LDAP server is bad or doesn't match. The likely fix here is to provide the ingress URLs assigned to glauth-k8s without the port number as subject alternative names in the glauth-k8s unit's generated TLS certificate:
We'd also likely want to handle the case where ingress has departed and we should refresh the certificate. Here's a copy of my sssd.conf file for reference:
On the brightside, sssd can successfully connect to glauth-k8s and start using remote users and groups if I disable StartTLS in glauth-k8s and set ldap_id_use_start_tls to False 😄
Temporary workarounds
There are a couple of hotfixes you can use to get around the Common Name (CN) mismatch, but they're a bit hacky wacky:
Update /etc/hosts to resolve ldap.glauth.com to ingress URL
If you update /etc/hosts to resolve the LoadBalancer IP to the glauth-k8s hostname, sssd will happily connect to glauth-k8s:
<LoadBalancer IP> ldap.glauth.com
However, this doesn't work in production since sssd doesn't receive the glauth-k8s hostname from the ldap integration.
Set ldap_tls_reqcert to allow in sssd.conf
You can also bypass the issue by setting ldap_tls_reqcert = allow in your domain configuration, however, this isn't advisable as it just tells sssd to ignore the TLS certificate if it's bad and query the LDAP server anyway.
The text was updated successfully, but these errors were encountered:
NucciTheBoss
changed the title
SSSD cannot use certificates from glauth-k8s unit because of Common Name (CN) mismatch
SSSD cannot use certificates because of Common Name (CN) mismatch
Jan 10, 2025
NucciTheBoss
changed the title
SSSD cannot use certificates because of Common Name (CN) mismatch
SSSD cannot use TLS certificates because of Common Name (CN) mismatch
Jan 10, 2025
NucciTheBoss
changed the title
SSSD cannot use TLS certificates because of Common Name (CN) mismatch
Machine charms with SSSD cannot use TLS certificates because of Common Name (CN) mismatch
Jan 10, 2025
@NucciTheBoss i might be totally worng here, but have u tried to set the external_hostname on the traefik charm first?
saying that as usually we get the hostname from the ingress charm, then expose it via our own charms
now that works flawlessly in a ingress-per-app case, not sure ingress-per-unit
here we have a bit of a pickle situation in which we have the ldap with StartTLS so both ingress and glauth can ask for a certificates relation, but if we have the ingress set we should probably get the certificate for that external hostname
Now that #84 is fixed (thank you @wood-push-melon!), the sssd operator can successfully pull the TLS certificates from glauth-k8s via the
certificate_transfer
interface. However, sssd still fails to connect to glauth because of a Common Name (CN) mismatch between the hostname that was used to generate the TLS certificate in the glauth-k8s unit and the ingress URL sssd is using to connect to glauth. The sssd service generates the following error logs when I try to start it up withldap_tls_reqcert
set tohard
(default):10.0.0.135 is the LoadBalancer IP used by Traefik, and
ldap.glauth.com
is the configured hostname for my deployed glauth-k8s unit.ldap_tls_reqcert = hard
basically tells sssd to wig out and throw out errors if the TLS certificate provided by the LDAP server is bad or doesn't match. The likely fix here is to provide the ingress URLs assigned to glauth-k8s without the port number as subject alternative names in the glauth-k8s unit's generated TLS certificate:glauth-k8s-operator/src/integrations.py
Lines 183 to 192 in 9c78ee2
updated to something like the following...
We'd also likely want to handle the case where ingress has departed and we should refresh the certificate. Here's a copy of my sssd.conf file for reference:
On the brightside, sssd can successfully connect to glauth-k8s and start using remote users and groups if I disable StartTLS in glauth-k8s and set
ldap_id_use_start_tls
toFalse
😄Temporary workarounds
There are a couple of hotfixes you can use to get around the Common Name (CN) mismatch, but they're a bit hacky wacky:
Update /etc/hosts to resolve
ldap.glauth.com
to ingress URLIf you update /etc/hosts to resolve the LoadBalancer IP to the glauth-k8s hostname, sssd will happily connect to glauth-k8s:
However, this doesn't work in production since sssd doesn't receive the glauth-k8s hostname from the
ldap
integration.Set
ldap_tls_reqcert
toallow
in sssd.confYou can also bypass the issue by setting
ldap_tls_reqcert = allow
in your domain configuration, however, this isn't advisable as it just tells sssd to ignore the TLS certificate if it's bad and query the LDAP server anyway.The text was updated successfully, but these errors were encountered: