Solved

unknown protocol: https!

Posted on 1997-05-29
11
600 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
11 Comments
 
LVL 6

Expert Comment

by:jpk041897
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 6

Expert Comment

by:jpk041897
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 6

Expert Comment

by:jpk041897
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This video teaches viewers about errors in exception handling.

762 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

12 Experts available now in Live!

Get 1:1 Help Now