Solved

Urgent Question

Posted on 2001-06-04
4
194 Views
Last Modified: 2010-03-31
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.
0
Comment
Question by:wilsontang
4 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 100 total points
ID: 6152076
0
 
LVL 3

Expert Comment

by:rjackman
ID: 6152107
y are u breaking ur url in parts try giving the continuous url
as
URL url = new URL     ( "https://10.10.10.1/template1/en:888/leftt1.htm);
i think this should work
cheers
RJ
0
 
LVL 4

Expert Comment

by:rdov
ID: 6152368
1. is your program an applet or an application?
2. where do you get the exception?
3. post the exception details.

0
 
LVL 3

Expert Comment

by:rkenworthy
ID: 6157398
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/servlet";

Hope that helps,
Rob
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countAbc challenge 9 50
Running Jira on Raspberry PI 2? 3 139
Checkbox and ListView in Android Layout 4 40
maven project error 5 24
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now