Author: olegk
Date: Sun Jan 30 13:02:40 2005
New Revision: 149154
URL: http://svn.apache.org/viewcvs?view=rev&rev=149154
Log:
Maven workaround
Modified:
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLTestProtocolSocketFactory.java
Modified:
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java?view=diff&r1=149153&r2=149154
==============================================================================
---
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java
(original)
+++
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java
Sun Jan 30 13:02:40 2005
@@ -1,7 +1,7 @@
/*
* $Header:
/home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java,v
1.1 2004/12/11 22:35:26 olegk Exp $
* $Revision: 1.1 $
- * $Date: 2004/12/11 22:35:26 $
+ * $Date$
*
* ====================================================================
*
@@ -37,6 +37,8 @@
import javax.net.ServerSocketFactory;
import org.apache.commons.httpclient.server.SimpleSocketFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import com.sun.net.ssl.KeyManager;
import com.sun.net.ssl.KeyManagerFactory;
@@ -49,12 +51,17 @@
*/
public class SimpleSSLSocketFactory implements SimpleSocketFactory {
+ private static final Log LOG =
LogFactory.getLog(SimpleSocketFactory.class);
+
private static SSLContext SSLCONTEXT = null;
private static SSLContext createSSLContext() {
try {
ClassLoader cl = SimpleSocketFactory.class.getClassLoader();
URL url =
cl.getResource("org/apache/commons/httpclient/ssl/simpleserver.keystore");
+ if (url == null) {
+ url = new
URL("file:src/test/org/apache/commons/httpclient/ssl/simpleserver.keystore");
+ }
KeyStore keystore = KeyStore.getInstance("jks");
keystore.load(url.openStream(), "nopassword".toCharArray());
KeyManagerFactory kmfactory = KeyManagerFactory.getInstance(
@@ -67,6 +74,7 @@
} catch (Exception ex) {
// this is not the way a sane exception handling should be done
// but for our simple HTTP testing framework this will suffice
+ LOG.error(ex.getMessage(), ex);
throw new IllegalStateException(ex.getMessage());
}
Modified:
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLTestProtocolSocketFactory.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLTestProtocolSocketFactory.java?view=diff&r1=149153&r2=149154
==============================================================================
---
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLTestProtocolSocketFactory.java
(original)
+++
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLTestProtocolSocketFactory.java
Sun Jan 30 13:02:40 2005
@@ -1,7 +1,7 @@
/*
* $Header:
/home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/test/org/apache/commons/httpclient/ssl/SimpleSSLTestProtocolSocketFactory.java,v
1.1 2004/12/11 22:35:26 olegk Exp $
* $Revision: 1.1 $
- * $Date: 2004/12/11 22:35:26 $
+ * $Date$
*
* ====================================================================
*
@@ -41,6 +41,8 @@
import org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory;
import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
import org.apache.commons.httpclient.server.SimpleSocketFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import com.sun.net.ssl.SSLContext;
import com.sun.net.ssl.TrustManager;
@@ -48,12 +50,17 @@
public class SimpleSSLTestProtocolSocketFactory implements
SecureProtocolSocketFactory {
+ private static final Log LOG =
LogFactory.getLog(SimpleSSLTestProtocolSocketFactory.class);
+
private static SSLContext SSLCONTEXT = null;
private static SSLContext createSSLContext() {
try {
ClassLoader cl = SimpleSocketFactory.class.getClassLoader();
URL url =
cl.getResource("org/apache/commons/httpclient/ssl/simpleserver.keystore");
+ if (url == null) {
+ url = new
URL("file:src/test/org/apache/commons/httpclient/ssl/simpleserver.keystore");
+ }
KeyStore keystore = KeyStore.getInstance("jks");
keystore.load(url.openStream(), "nopassword".toCharArray());
TrustManagerFactory tmfactory = TrustManagerFactory.getInstance(
@@ -66,6 +73,7 @@
} catch (Exception ex) {
// this is not the way a sane exception handling should be done
// but for our simple HTTP testing framework this will suffice
+ LOG.error(ex.getMessage(), ex);
throw new IllegalStateException(ex.getMessage());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]