# LDAPS Test Authentication failing by using User Federation module in keycloak

**URL:** <https://forum.keycloak.org/t/ldaps-test-authentication-failing-by-using-user-federation-module-in-keycloak/18594>\
**Category:** Getting advice\
**Tags:** authentication, ldap\
**Created:** [November 25, 2022, 6:19am UTC](https://forum.keycloak.org/t/ldaps-test-authentication-failing-by-using-user-federation-module-in-keycloak/18594 "2022-11-25T06:19:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevopsFan](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DevopsFan](https://forum.keycloak.org/u/DevopsFan)\
**Post date:** [November 25, 2022, 6:19am UTC](https://forum.keycloak.org/t/ldaps-test-authentication-failing-by-using-user-federation-module-in-keycloak/18594/1 "2022-11-25T06:19:10Z")

</div>

We created LDAPS server with CA cert and tested in my client server with that cert then able to working.  
Same thing tried Kubernetes keycloak container but ‘test authentication failing’  
Kyecloak version - 3.0.0

1. Created truststore.jks  
`keytool -import -alias ldapcert -keystore truststore.jks -file ca-certificates.crt -storepass changeit -noprompt`
2. Created Kubernetes secret  
`kubectl create secret generic ldap-keystore --from-file=truststore.jks`
3. Volume mount and JAVA\_OPTS

```auto
extraEnv: |
  - name: KEYCLOAK_USER
    value: AdminUser
  - name: KEYCLOAK_PASSWORD
    value: AdminPassword
  - name: PROXY_ADDRESS_FORWARDING
    value: "true"
  - name: JAVA_OPTS
    value: >-
      -XX:+UseContainerSupport
      -XX:MaxRAMPercentage=50.0
      -Djava.net.preferIPv4Stack=true
      -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS
      -Djava.awt.headless=true
      -Djavax.net.ssl.trustStore=/opt/jboss/.cacerts/truststore.jks
      -Djavax.net.ssl.trustStorePassword=LDAPS_TRUSTSTORE_PASSWORD
extraVolumes: |
  - name: scert
    secret:
      secretName: ldap-keystore
extraVolumeMounts: |
  - name: scert
    mountPath: /opt/jboss/.cacerts
    readOnly: true

```

Step 4  
deployed keycloak trough HELM!

But getting below error

```auto
No truststore provider found - using default SSLSocketFactory
ERROR [org.keycloak.services] (default task-12) KC-SERVICES0055: Error when authenticating to LDAP: simple bind failed: <FQDN>:636: javax.naming.CommunicationException: simple bind failed: <FQDN>:636 [Root exception is javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]

```
