[xgws-dev] CVS Update: codes/xsul/java/modules/http_server/xsul/http_server/impl
Aleksander Andrzej Slominski
xgws-dev_at_extreme.indiana.edu
Wed Feb 21 16:18:01 2007
aslom 07/02/21 16:17:56
Modified: xsul/java/modules/http_server/xsul/http_server/impl
HttpServerRequestImpl.java
Log:
allow to run embedded http server without puretls on classpath
Revision Changes Path
1.15 +30 -25 codes/xsul/java/modules/http_server/xsul/http_server/impl/HttpServerRequestImpl.java
Index: HttpServerRequestImpl.java
===================================================================
RCS file: /l/extreme/cvs/codes/xsul/java/modules/http_server/xsul/http_server/impl/HttpServerRequestImpl.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -t -w -r1.14 -r1.15
--- HttpServerRequestImpl.java 27 Jan 2007 00:07:59 -0000 1.14
+++ HttpServerRequestImpl.java 21 Feb 2007 21:17:56 -0000 1.15
@@ -4,7 +4,7 @@
*
* This software is open source. See the bottom of this file for the licence.
*
- * $Id: HttpServerRequestImpl.java,v 1.14 2007/01/27 00:07:59 aslom Exp $
+ * $Id: HttpServerRequestImpl.java,v 1.15 2007/02/21 21:17:56 aslom Exp $
*/
package xsul.http_server.impl;
@@ -37,7 +37,7 @@
/**
* Base exception thrown by all HTTP server side operations.
*
- * @version $Revision: 1.14 $
+ * @version $Revision: 1.15 $
* @author <a href="http://www.extreme.indiana.edu/~aslom/">Aleksander Slominski</a>
*/
public class HttpServerRequestImpl implements HttpServerRequest {
@@ -93,7 +93,10 @@
detectSecurity(socket);
}
+ private static boolean hasPureTls = true;
private void detectSecurity(Socket socket) {
+ if(!hasPureTls) return;
+ try {
if(socket instanceof SSLSocket) {
try {
SSLSocket s=(SSLSocket)socket;
@@ -118,14 +121,16 @@
logger.info("could not extract security info from "+socket, e);
}
}
-
-
+ } catch (NoClassDefFoundError e) {
+ hasPureTls = false;
}
+ }
+
public Object getAttribute(String attrName) throws HttpServerException {
if(!attrName.equals(ATTR_X509_CERTS)) return null;
-
+ //assert attrName.equals(ATTR_X509_CERTS);
return x509Certs;
}