Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unknown protocol: https

8 views
Skip to first unread message

Paweł Szczerba

unread,
Oct 18, 2001, 7:41:54 AM10/18/01
to
Hello :-)

Can anybody help me with 'unknown protocol: https' ?
Here is the code.

// X.java
import java.net.*;
import java.io.*;
import java.security.*;
public class X {
public static void main( String[] args ) {
try {
System.setProperty( "java.protocol.handler.pkgs",
"com.sun.net.ssl.inernal.www.protocol" );
// System.setProperty("https.proxyHost", "192.168.65.100");
// System.setProperty("https.proxyPort", "8080");
Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider());
URL url = new URL( "https://www.mbank.com.pl/" );
String txt;
BufferedReader br = new BufferedReader(
new InputStreamReader(
url.openStream()));
while( (txt = br.readLine()) != null ){
System.out.println( txt );
}
}
catch( Exception e ) {
e.printStackTrace();
}
}
}

I run it by
java -classpath E:\jdk1.3.1\jre\lib\ext\jsse.jar;. X

System anwsers:
java.net.MalformedURLException: unknown protocol: https
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at X.main(X.java:15)

What is wrong here?

Regards

--
Paweł Szczerba
+48 603 651 731
mailto:pawel.s...@ksconsulting.com.pl

ALPER

unread,
Oct 18, 2001, 7:54:17 AM10/18/01
to

> I run it by
> java -classpath E:\jdk1.3.1\jre\lib\ext\jsse.jar;. X
>
> System anwsers:
> java.net.MalformedURLException: unknown protocol: https
> at java.net.URL.<init>(Unknown Source)
> at java.net.URL.<init>(Unknown Source)
> at java.net.URL.<init>(Unknown Source)
> at X.main(X.java:15)
>

include jnet.jar from jsse also in your classpath!

cheers


Paweł Szczerba

unread,
Oct 18, 2001, 10:38:21 AM10/18/01
to
ALPER <aoez...@hotmail.com> wrote in
news:10034061...@fuchs.cyberlink.ch:

Still thesame error :-(

ALPER

unread,
Oct 18, 2001, 11:07:51 AM10/18/01
to
System.setProperty( "java.protocol.handler.pkgs",
"com.sun.net.ssl.inernal.www.protocol" );
^
youve forgotten the t :)

Paweł Szczerba

unread,
Oct 18, 2001, 2:00:32 PM10/18/01
to
ALPER <aoez...@hotmail.com> wrote in
news:10034177...@fuchs.cyberlink.ch:

Well, I need to change my glassess ;-)
Thanks. Now it works.

0 new messages