Cas Client PKIX path building failed

67 views
Skip to first unread message

fasr favk

unread,
Jun 19, 2023, 7:43:20 AM6/19/23
to CAS Community
Hello, my cas server is working fine, but when i try to log in to my cas client application with spring boot , it gives this error :
"PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target..."

i already imported my cas.crt to cacerts in my jdk 17. with keytool:
keytool -import -file "C:\etc\cas\cas.crt" -alias cas -keystore "C:\Program Files\Java\jdk-17\lib\security\cacerts"
NB: after refreshing my cas server i can see myself logged in with cas client, and am using ldap for auth
err.png

Ray Bon

unread,
Jun 21, 2023, 11:01:53 AM6/21/23
to cas-...@apereo.org
The backend communication between cas and the client needs to be https, even if the browser URL is http.

Check tomcat config (or whatever container you are using), which also needs to know about the cert.
I have this in server.xml on my laptop:

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true" keystorePass="password"
keystoreFile="/etc/ssl/certs/thekeystore" clientAuth="false" sslProtocol="TLS">
</Connector>

Ray

On Mon, 2023-06-19 at 04:43 -0700, fasr favk wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

Petr Bodnár

unread,
Jul 2, 2023, 7:46:27 AM7/2/23
to CAS Community, Ray Bon
Hi, provided you've got setup CAS and its certificate correctly, did you check that your Java client application really uses the truststore file located at "C:\Program Files\Java\jdk-17\lib\security\cacerts"? You can do that by adding the following JVM option (system property) when starting the Java application: "-Djavax.net.debug=trustmanager" (or "-Djavax.net.debug=all", but that will output MUCH more lines).

fasr favk

unread,
Jul 4, 2023, 8:49:10 AM7/4/23
to CAS Community, p.bo...@centrum.cz, Ray Bon
Thank you that was helpful, my app was using the wrong trustore
Reply all
Reply to author
Forward
0 new messages