import java.io.*;
import java.net.*;//connenction hpu.edu.cn's IP CGI
public class ConCGI
{
public static void main(String [] args)
{
String url = "https://ipgw.jzit.edu.cn"; //base url 
String cgi = "/cgi-bin/setip";
String pname = "pname=myid";
String ppass = "ppass=password";
String ipfw = "ipfw=2"; //connection China

//use get send data,this is the final url
String finalURL = url + cgi + "?" + pname + "&" + ppass + "&" + ppass + "&" + ipfw;

//Send the GET request,and dispaly output
try
{
//construct the url object,and send the GET request
URL conURL = new URL(finalURL);

//Open a connection,and dispaly output responest from sevrer
InputStream input = conURL.openStream();
BufferedInputStream bufIn = new BufferedInputStream(input);

//repeat until end of the input
for(;;)
{
int data = bufIn.read();
if(data == -1)
break;
else
System.out.print((char)data);
}
}catch(MalformedURLException e)
{
System.err.println("Bad URL -- " + finalURL );
}catch(IOException e)
{
System.out.println("I/O error " + e);
}
}

运行些程序时出现:I/O error javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorE
xception: No trusted certificate found
说明没有发现可信任的证书,我在本地安装完ipfw的证书后,用IE不会提示安装证书了,但运行这程序还是同样的异常!我应该在程序中发送证书的相关内容吗?发送哪些?大家一起讨论