Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.net
Class WebEnvironment  view WebEnvironment download WebEnvironment.java

java.lang.Object
  extended bycom.eireneh.net.WebEnvironment

public class WebEnvironment
extends java.lang.Object

A quick way of testing CommsXL

Enabling HTTPS

This could use the HTTPCLient handler from innovation.ch however this fails because there are handlers only for http not https System.getProperties().setProperty("java.protocol.handler.pkgs", "HTTPClient");
Normally this fails with: java.lang.ClassFormatError: HTTPClient/CookieModule (Invalid start_pc/length in local var table) However if you compile with jikes ... java.lang.NoClassDefFoundError: HTTPClient/https/Handler (wrong name: sunw/hotjava/protocol/https/Handler)

If you simply include the HotJava jars in the CLASSPATH then URL will automatically try to use them. However I think they only work at 1.1 Using JDK 1.2 without changing your PATH gives:

 javax.net.ssl.SSLException: Received fatal alert: handshake_failure (no cipher suites in common)
   at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:951)
   at sun.security.ssl.SSLSocketImpl.clearPipeline(SSLSocketImpl.java:684)
   at sun.security.ssl.SSLSocketImpl.write(SSLSocketImpl.java:437)
   ...
 

Adding the HotJava bin dir to the path (so that we get a look at jsafe.dll alters this (slightly) so we get a windows linker error on javai.dll (from 1.1) Adding the HotJava/runtime dir to the path too changes the error to:

 java.lang.UnsatisfiedLinkError: initIDs
   at sun.security.ssl.Handshaker.maybeSetCipherSuite(Handshaker.java:444)
   at sun.security.ssl.ClientHandshaker.serverHello(ClientHandshaker.java:341)
   at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:119)
   at sun.security.ssl.Handshaker.process_record(Handshaker.java:256)
   at sun.security.ssl.SSLSocketImpl.clearPipeline(SSLSocketImpl.java:625)
   at sun.security.ssl.SSLSocketImpl.write(SSLSocketImpl.java:437)
   ... (note similarity with above)
 
We should maybe add the PlugProv.jar to the CLASSPATH?

This attempts to make us use the SSLava handlers, this works, but it costs $2500 URL.setURLStreamHandlerFactory(new crysec.https.HttpsURLStreamHandlerFactory());

Adding the JWS2 jars also works, but for free.


Field Summary
private static int id
          The next unique id
private static java.lang.Object sync
          The object to sync on
 
Constructor Summary
WebEnvironment()
           
 
Method Summary
 WebBrowser getBrowser()
          Works out the reply number 404 or something public void alert(String contents) { log.fine(contents); } /** Works out the reply number 404 or something
 int getInstanceID()
          Get a number that is garantteed unique in this VM
private static int getInstanceIDStatic()
          Get a number that is garantteed unique in this VM
 void setProxy(java.lang.String host, int port)
          Sets new proxy settings
 void snooze(int millis)
          Check that the given string exists in the data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sync

private static java.lang.Object sync
The object to sync on


id

private static int id
The next unique id

Constructor Detail

WebEnvironment

public WebEnvironment()
Method Detail

snooze

public void snooze(int millis)
Check that the given string exists in the data


getBrowser

public WebBrowser getBrowser()
Works out the reply number 404 or something public void alert(String contents) { log.fine(contents); } /** Works out the reply number 404 or something


getInstanceID

public int getInstanceID()
Get a number that is garantteed unique in this VM


getInstanceIDStatic

private static int getInstanceIDStatic()
Get a number that is garantteed unique in this VM


setProxy

public void setProxy(java.lang.String host,
                     int port)
Sets new proxy settings