Solved

unknown protocol: https!

Posted on 1997-05-29
11
640 Views
Last Modified: 2012-05-04
For the foolowing codeURL url = new URL("https://orders4.xxx.com/cgi-bin/vfpwebn.exe/xx");I will get the following runtime error:MalformedURLException: java.net.MalformedURLException: unknown protocol: https
How can I connect to secure protocol?
0
Comment
Question by:homeira_amirkhani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 6

Expert Comment

by:jpk041897
ID: 1221074
https is not supported dirrectly by java since it requires authorization. You can still ac4ess the pages though using http and code to access secure web pages.

The code to access such a page is rather large and is documented in the previously answered questionsection of this forum under:

  5/5/97  20 Retrieval of URL with authorization            rhee

Take a look at  the contents (I suggest you print the info iin that page since it comes out to about 10 printed pages).

Let me know if the inffo contained there is enough for your purposes, otherwise we can look at additionul alternatives.






 
0
 
LVL 3

Expert Comment

by:pc012197
ID: 1221075
Of course java can access https: URLs. Well, it depends on the VM. Netscape does it. HotJava probably doesn't.

0
 

Author Comment

by:homeira_amirkhani
ID: 1221076
I looked at the sources provided by "jpk". Good resources but  they were all talking about how to access cgi (post) using URLConnection etc. but I did not see anything for https or SSL. I understand that that accessing SSL is not trivial and require writing classes to handle that protocol. But my problem is the starting point, I can not create a valid URL from the address https://... to proceed and use URLConnection and so on. Also I test hotjava it has also have problem connecting to https://... I looked at the known bugs of HotJava and it has"The HotJava Browser cannot connect to certain SSL3 sites. In particular, it cannot connect to sites using X.509 certificates with some newer encodings for X.500 names, such as those using IA5 (ASCII) strings. (4039466)"then I think "pc" is right it is the matter of VM. but I don't know how I can access Netscape VM. It has only some dll files.I also find "Java SSL implementation" in Gamelan which I could not access it (the URL did not work). As soon as I get that and test it I will let you know if it helps. Apprently it uses SSLeay which is the security layer of Netscape.By the way if you have a good answer just let me know and I will increase the points. It is just that I am afraid it will leave unansweed and I loose those points.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:jpk041897
ID: 1221077
No, you don't loose the points. If you provide the answer yourself, no one provides a valid answer, or the question is unanswerable, you can cancel the question by posting a request to do so in the customer support forum of Experts Exchange. You the recover your points.
0
 

Author Comment

by:homeira_amirkhani
ID: 1221078
Where is that customer support to cancel the question. I looked at edit question there is no option to cancel. Neither is in my customer info.
I don't know where should I post sucha cases.

0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1221079
Login at the home page:

http://www.experts-exchange.com/topics/

on the lower right you will find a forum called costumer service.

In that forum, post a question offering 0 points requesting that your points be canceled and giving the reason as the text of the question. State that you found out the solution on your own and give a reference (forum question, author and points) to which question you wish to cancel.
0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1221080
You might want to check out:

http://www.phaos.com/solutions.html

They have a toolkit there that seems to support evrything you want.
0
 
LVL 1

Expert Comment

by:mwwhite
ID: 1221081
Call the method createURLStreamHandler from the  java.net.URLStreamHandlerFactory class. You pass it a string containing the protocol name (i.e. "https") and it will allow you to create URL's with the https protocol.

   Example call:
   createURLStreamHandler("https");

0
 

Author Comment

by:homeira_amirkhani
ID: 1221082
java.net.URLStreamHandlerFactory is an interface so far I have not able to find any class to implement that interface. If you mean I have to write a class to implement this interface then my problem still remains. IF you have ever done that meaning successfully connected to https and was able to retrive data I appreciate more help.
0
 

Author Comment

by:homeira_amirkhani
ID: 1221083
java.net.URLStreamHandlerFactory is an interface so far I have not able to find any class to implement that interface. If you mean I have to write a class to implement this interface then my problem still remains. IF you have ever done that meaning successfully connected to https and was able to retrive data I appreciate more help.
0
 

Accepted Solution

by:
ajchen earned 250 total points
ID: 1221084
Check out BDK1.0 from Sun.  It's Bean Development Kit 1.0.  You can create your own "URLStreamHandlerFactory".  The javadoc was wrong in saying that you could use this class.  Basically, you need to set up your System Property that points to your own protocol.

For example, look under bdk1.0/beanbox/sun/beanbox.  Go to simpleresource directory and check it out.  Your implementation of https protocol is probably straight-forward by just forwarding contents back and forth since you shouldn't be dealing with SSL itself.

Hope this helps.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

632 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