What's problem with javax.net.ssl.HttpsUrlConnection

what is problem with following code

import java.io.*;

import java.net.*;

import javax.net.ssl.*;

public class HttpsURL{

public static void main(String[] argv) throws Exception {

URL url = new URL(argv[0]);

HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();

connection.setDoOutput(true);

BufferedReader in = new BufferedReader(

new InputStreamReader(connection.getInputStream()));

String line;

while ((line = in.readLine()) != null) {

System.out.println(line);

}

in.close();

}

}

it returned

Exception in thread "main" javax.net.ssl.SSLHandshakeException: Couldn't find trusted certificate

Please help me, I will be sacked by tomorrow if it's not solved.

[807 byte] By [Akshaya] at [2007-10-2 9:06:36]
# 1
Calm down. How does your URL look like? Does it have the https protocol prefix? Did you wrote a custom TrustManager to accept specific certificates? Did you wrote a custom HostnameVerifier?
MartinHilperta at 2007-7-16 23:13:40 > top of Java-index,Archived Forums,Socket Programming...
# 2

Hi,

I tried this code.

URL url = new URL("https://wwwcie.ups.com/ups.app/xml/Rate");

Actually I am dot net developer and my boss told me to start java and gave me a project where I have to get shipping cost from UPS server. All the things in dot net works fine.

What is TrustManager and HostNameVerifier? Could you please help me with these two things?

Thank you.

Akshay

Akshaya at 2007-7-16 23:13:40 > top of Java-index,Archived Forums,Socket Programming...