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
include jnet.jar from jsse also in your classpath!
cheers
Well, I need to change my glassess ;-)
Thanks. Now it works.