?
Solved

unknown protocol: https!

Posted on 1997-05-29
11
Medium Priority
?
689 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
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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 500 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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month6 days, 8 hours left to enroll

592 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