2002/07/02 00:17:23
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:48:40 +0000 (06:48 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:48:40 +0000 (06:48 +0000)
darcs-hash:20040130064840-2ba56-26d80ef00260f5e5d97ecb12153554127acaa28e.gz

CHANGES
src/org/xwt/HTTP.java
src/org/xwt/TinySSL.java

diff --git a/CHANGES b/CHANGES
index a872ea5..9d3809d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 
 01-Jul megacz HTTP.java: we no longer insert the IP into the URL.
 
+01-Jul megacz TinySSL.java, HTTP.java: fixed SSL-over-Proxy
+
index 6323b52..3ac94fe 100644 (file)
@@ -140,10 +140,10 @@ public class HTTP {
             if (!ssl) {
                 path = "http://" + host + ":" + port + path;
             } else {
-                if (Log.on) Log.log(this, "attempting to create HTTP proxied socket using proxy " + proxyHost + ":" + proxyPort);
                 PrintWriter pw = new PrintWriter(new OutputStreamWriter(sock.getOutputStream()));
                 BufferedReader br = new BufferedReader(new InputStreamReader(sock.getInputStream()));
-                pw.print("CONNECT " + host + ":" + port + " HTTP/1.0\r\n\r\n");
+                pw.print("CONNECT " + host + ":" + port + " HTTP/1.1\r\n\r\n");
+                pw.flush();
                 String s = br.readLine();
                 if (s.charAt(9) != '2') throw new HTTPException("proxy refused CONNECT method: \"" + s + "\"");
                 while (br.readLine().length() > 0) { };
index e3f90ab..44b998c 100644 (file)
@@ -137,8 +137,8 @@ public class TinySSL extends Socket {
 
     public X509CertificateStructure server_cert = null;
 
-    public SSLOutputStream os;
-    public SSLInputStream is;
+    public SSLOutputStream os = null;
+    public SSLInputStream is = null;
 
     String hostname;
 
@@ -148,8 +148,8 @@ public class TinySSL extends Socket {
     /** true iff we're using SSL_RSA_EXPORT_WITH_RC4_40_MD5 */
     boolean export = false;
 
-    public InputStream getInputStream() { return is; }
-    public OutputStream getOutputStream() { return os; }
+    public InputStream getInputStream() throws IOException { return is != null ? is : super.getInputStream(); }
+    public OutputStream getOutputStream() throws IOException { return os != null ? os : super.getOutputStream(); }
 
     public TinySSL(String host, int port) throws IOException { this(host, port, true); }
     public TinySSL(String host, int port, boolean negotiateImmediately) throws IOException {