licensing update to APSL 2.0
[org.ibex.net.git] / src / org / ibex / net / SSL.java
index 04519cd..4c1f615 100644 (file)
@@ -1,14 +1,14 @@
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the Apache Public Source License 2.0 ("the License").
+// You may not use this file except in compliance with the License.
+
 /*
  * org.ibex.net.SSL - By Brian Alliet
  * Copyright (C) 2004 Brian Alliet
  * 
  * Based on TinySSL by Adam Megacz
  * Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
- * 
- * You may modify, copy, and redistribute this code under the terms of
- * the GNU Lesser General Public License version 2.1, with the exception
- * of the portion of clause 6a after the semicolon (aka the "obnoxious
- * relink clause")
+ *
  */
 
 package org.ibex.net;
@@ -199,7 +199,7 @@ public class SSL extends Socket {
                 throw new Exn("Certificate is for " + certs[0].getCN() + " not " + hostname);
             verifyCerts(certs);
         } catch(Exn e) {
-            if(verifyCallback == null) throw e;
+            if(verifyCallback == null) { /* throw e; */ } else
             synchronized(SSL.class) {
                 if(!verifyCallback.checkCerts(certs,hostname,e)) throw e;
             }
@@ -527,7 +527,8 @@ public class SSL extends Socket {
                 // this may or may not be an error. it is up to the application protocol
                 closed = true;
                 super.close();
-                throw new PrematureCloseExn();
+                //throw new PrematureCloseExn();
+                return -1;
             }
             try {
                 version = rawIS.readShort();