wilsontang
asked on
Urgent Question
hi,
How to call URL with https protocol? Suppose changing the protocol will be fine.
I am using JDK1.2.2
My program is as follows:
URL url = new URL ( "https", "10.10.10.1/template1/en/" , 8888, "leftt1.htm" );
URLConnection uc = url.openConnection();
uc.setDoOutput( true );
uc.connect();
InputStream in = uc.getInputStream();
The error message is unknown protocol.
How to call URL with https protocol? Suppose changing the protocol will be fine.
I am using JDK1.2.2
My program is as follows:
URL url = new URL ( "https", "10.10.10.1/template1/en/"
URLConnection uc = url.openConnection();
uc.setDoOutput( true );
uc.connect();
InputStream in = uc.getInputStream();
The error message is unknown protocol.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1. is your program an applet or an application?
2. where do you get the exception?
3. post the exception details.
2. where do you get the exception?
3. post the exception details.
This is how I do it and it works:
URL url =
new URL(protocol, serverIP, serverPort, serverPath);
where the parameters might be initialized as follows:
String protocol = "https";
String serverIP = "90.0.0.1";
String serverPort = "2020"; //?? your secure port
String serverPath = "/whatever/servletpath/ser vlet";
Hope that helps,
Rob
URL url =
new URL(protocol, serverIP, serverPort, serverPath);
where the parameters might be initialized as follows:
String protocol = "https";
String serverIP = "90.0.0.1";
String serverPort = "2020"; //?? your secure port
String serverPath = "/whatever/servletpath/ser
Hope that helps,
Rob
as
URL url = new URL ( "https://10.10.10.1/template1/en:888/leftt1.htm);
i think this should work
cheers
RJ