Dear Experts.
I created an application which uses external web service. I created web service client and proxy from https://secure.przelewy24.pl/external/wsdl/services.php?wsdl
Then I copied certificate from website to jre\lib\security folder and executed:
keytool -import -v -file secure.przelewy24.pl.cer -keypass DemoIdentityKeyStorePassPhrase -keystore cacerts -alias P24
I received a confirmation that certificate was added to keystore, so I have started to write sample test method:
public boolean P24_connector(String login, String pass){
boolean rstl;
try{
rstl = przelewy24Port.testAccess(login, pass);
}catch (Exception e){
e.printStackTrace();
return false;
}
return rstl;
}
to test it. I get stack trace
javax.xml.ws.WebServiceException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
...
Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
...
Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
...
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Any help would be appreciated.
Regards.
Rob
Next try. I generated keystore file from CER file
keytool -import -trustcacerts -keystore p24 -storepass Password12 -noprompt -file secure.przelewy24.pl.crt
and verified keytool -list -keystore p24
Finally I modified sample test method.
public boolean P24_connector(String login, String pass){
boolean rstl;
System.setProperty("javax.net.ssl.trustStore", "D:/JDeveloper/gen/ViewController/p24");
System.setProperty("javax.net.ssl.trustStorePassword", "Password12");
System.setProperty("javax.net.ssl.trustStoreType", "jks");
try{
rstl = przelewy24Port.testAccess(login, pass);
}catch (Exception e){
System.out.println(e.toString());
e.printStackTrace();
return false;
}
return rstl;
}
Still no luck.
Regards