X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FTinySSL.java;h=e3f90ab20073561d6551800dc095cd22e4fb8c21;hb=fa18ff2c6785c96c00d19092338f404ad7f6240c;hp=41e83a15ab433a2b97cb2386c97314b363144bcb;hpb=7c52b4652385c6a0d3aecc1826524e495076a07b;p=org.ibex.core.git diff --git a/src/org/xwt/TinySSL.java b/src/org/xwt/TinySSL.java index 41e83a1..e3f90ab 100644 --- a/src/org/xwt/TinySSL.java +++ b/src/org/xwt/TinySSL.java @@ -151,12 +151,17 @@ public class TinySSL extends Socket { public InputStream getInputStream() { return is; } public OutputStream getOutputStream() { return os; } - public TinySSL(String host, int port) throws IOException { + public TinySSL(String host, int port) throws IOException { this(host, port, true); } + public TinySSL(String host, int port, boolean negotiateImmediately) throws IOException { super(host, port); hostname = host; + if (negotiateImmediately) negotiate(); + } + + /** negotiates the SSL connection */ + public void negotiate() throws IOException { os = new SSLOutputStream(super.getOutputStream()); is = new SSLInputStream(super.getInputStream()); - os.writeClientHello(); is.readServerHandshakes(); os.sendClientHandshakes();