Unable to find valid certification path to requested target
843811Sep 12 2007 — edited Nov 26 2007I am writting an application that uses SSL with an
HttpsUrlConnection. In production we use a certificate signed by
Verisign. In our test environment we are going against a server that
uses a self signed certificate. Production works fine, but in our
test enviroment I am getting the following error:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
Here is a snippett of my code:
m_url = new URL(m_urlString);
m_urlConnection = m_url.openConnection();
m_httpsUrlConnection = (HttpsURLConnection)m_urlConnection;
m_httpsUrlConnection.setRequestMethod("POST");
m_httpsUrlConnection.addRequestProperty("Content-Type",
"multipart/form-data");
m_httpsUrlConnection.setDoInput(true);
m_httpsUrlConnection.setDoOutput(true);
m_httpsUrlConnection.setUseCaches(false);
m_httpsUrlConnection.connect();
It throws the error on the .connect()
I've seen previous posts on this subject matter and either I'm doing
something wrong or I'm not understanding the solutions given. We use
Weblogic and I have the server.key, server.crt, and the server.csr
files. Do I need to load one of these into a keystore? If so how?
I've been spinning my wheels on this one, so I would greatly
appreciate any help someone can give me.
Thanks in advance.