Hi,

in my application I am using url fetch in combination with the https
protocol and a POST request. This works flawless both in production
and in development mode. However when I wrote the corresponding JUnit-
Tests, it failed with the following error message:

java.lang.AssertionError: 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

I got rid of this error by adding the certificate of the website,
which I am connecting to, to a keystore file. Afterwards I specified
its location using the following commands:

System.setProperty("javax.net.ssl.trustStore", KEYSTORE_PATH);
System.setProperty("javax.net.ssl.trustStorePassword",
KEYSTORE_PASSWORD);

In order to validate the correctness of this solution, I used the
following test:

SSLSocket s = (SSLSocket)
SSLSocketFactory.getDefault().createSocket("mydomain", 443);
s.startHandshake();
s.close();

It started to succeed using this setup. However for the original JUnit-
Test, I observed a strange behaviour: the request succeeded with
response code 200 (OK), but the response had zero size, which is not
at all expected.

Does anybody have an advice for me in order to solve this problem?
Thank you very much
Jay

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to