0

I am running the sample of playground2 from wso2 this post, I am getting following error when I am submitting the form for Get Access Token

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Community
  • 1
  • 1
deen
  • 2,185
  • 7
  • 29
  • 53

4 Answers4

2

Did you try adding the certificate of the server to java ca. Basically you need to add the certificate of the WSO2 server to the java cacerts. Bellow post explains how to add the certificate of the super tenant to java cacerts

http://isharaaruna.blogspot.com/2013/11/adding-certificate-to-java-ca.html?view=timeslide

Maduranga Siriwardena
  • 1,341
  • 1
  • 13
  • 27
1

After googling I found solution, If any one facing with similar issue follow this steps:-

1) save this code with name InstallCert.java

2) compile and run with,

java InstallCert ipaddress:port

Here, ipaddress and port is your ipaddress and port number from where your are trying to Handshake

3) press 1 when it asked for

4) after that it'll generate some crt file, pest it under your JAVA_HOME/jre/lib/security

5) restart your server

deen
  • 2,185
  • 7
  • 29
  • 53
  • While I prefer using a truststore this method proved to me that the REST connection works over https and that thre must be something wrong with how I created the truststore. +1 – Avec Apr 29 '20 at 14:26
0

That exception usually means that the OAuth client doesn't trust the server's SSL certificate I assume it happens when calling the token service the get the user token, more information (full stacktrace?) could be more useful to find out what is going on.

The first thing you can try is to import the server public certificate to the client's (tomcat) truststore.

I assume you need to take the SSL certificate of the WSO2 IS server (just export it via your browser) and create an additional Tomcat trutstore (exaamples)

Community
  • 1
  • 1
gusto2
  • 11,210
  • 2
  • 17
  • 36
0

You need to incert https site's ssl root certificate to cacert of jre.

I think THIS post would really help it is descriptive enough.

please make sure you are performing all actions on jre which is used by your application.

Community
  • 1
  • 1
positivecrux
  • 1,307
  • 2
  • 16
  • 35