public TinySSL(String host, int port, boolean negotiateImmediately) throws IOException { this(host, port, negotiateImmediately, false); }
public TinySSL(String host, int port, boolean negotiateImmediately, boolean ignoreUntrustedCert) throws IOException {
super(host, port);
+ if (!initializationFinished) {
+ synchronized(TinySSL.class) {
+ while (!initializationFinished)
+ try { TinySSL.class.wait(); } catch (Exception e) { }
+ }
+ }
hostname = host;
this.ignoreUntrustedCert = ignoreUntrustedCert;
if (negotiateImmediately) negotiate();
}
}
+ private static volatile boolean initializationFinished = false;
static {
-
entropySpinner[] spinners = new entropySpinner[10];
for(int i=0; i<spinners.length; i++) spinners[i] = new entropySpinner();
md5.doFinal(randpool, 0);
if (Log.on) Log.log(TinySSL.class, "TinySSL is initialized.");
+ initializationFinished = true;
+ TinySSL.class.notifyAll();
}