Unable to find valid certification path to requested target



I 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.

.



Relevant Pages

  • IIS SSL Config - 404 Error
    ... because when I do the same thing for the production ... server I ... get exactly what you expect, that is, the certificate warning. ... If I ignore the warning, I can continue browsing the site using HTTPS ...
    (microsoft.public.inetserver.iis.security)
  • The server certificate for instance 4 has expired or is not yet valid.
    ... We have three environments test, acceptance and production. ... I set the Certificate Trust List ...
    (microsoft.public.win2000.security)
  • Re: Https setup Question
    ... "Alok Kumar" wrote in message ... > If you want a free server certificate then download the open SSL package ... > then you can generate a server certificate for yourself. ... > You can also use this in production if you know the users. ...
    (microsoft.public.inetserver.iis)
  • Re: Certificate chain
    ... In test environment I found out that I ... CDP that is available on http url but there is no crl file jet. ... I totally agree that we should purchase certificate from one of trusted CAs ...
    (microsoft.public.security)
  • Re: Err:The server certificate for instance 4 has expired or is not
    ... acceptance and production. ... digital certificate" this box is empty in acceptance and filled in test ... Event Source: W3SVC ...
    (microsoft.public.inetserver.iis.security)