Index: trunk/calendar3/bldfiles/buildwar.xml
===================================================================
--- trunk/calendar3/bldfiles/buildwar.xml (revision 723)
+++ trunk/calendar3/bldfiles/buildwar.xml (revision 741)
@@ -301,4 +301,5 @@
+
Index: trunk/calendar3/bldfiles/defjars.properties
===================================================================
--- trunk/calendar3/bldfiles/defjars.properties (revision 724)
+++ trunk/calendar3/bldfiles/defjars.properties (revision 741)
@@ -85,4 +85,7 @@
commons-logging.jar=${commons.dir}/commons-logging.jar
+# commons-ssl.jar Used by httpclient for https
+commons-ssl.jar=${commons.dir}/commons-ssl.jar
+
# commons-validator.jar Used for struts.
commons-validator.jar=${commons.dir}/commons-validator-1.3.0.jar
Index: trunk/calendar3/caldavClientApi/build.xml
===================================================================
--- trunk/calendar3/caldavClientApi/build.xml (revision 415)
+++ trunk/calendar3/caldavClientApi/build.xml (revision 741)
@@ -40,4 +40,5 @@
+
Index: trunk/calendar3/caldavClientApi/src/org/bedework/caldav/client/api/CaldavClientIo.java
===================================================================
--- trunk/calendar3/caldavClientApi/src/org/bedework/caldav/client/api/CaldavClientIo.java (revision 736)
+++ trunk/calendar3/caldavClientApi/src/org/bedework/caldav/client/api/CaldavClientIo.java (revision 741)
@@ -65,7 +65,9 @@
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.contrib.ssl.BaseProtocolSocketFactory;
import org.apache.commons.httpclient.protocol.Protocol;
-import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
-import org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory;
+//import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
+//import org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory;
+import org.apache.commons.ssl.TrustMaterial;
import org.apache.log4j.Logger;
@@ -116,9 +118,24 @@
if (secure) {
+ /*
ProtocolSocketFactory pfact = new SSLProtocolSocketFactory();
Protocol pr = new Protocol("https", pfact, port);
Protocol.registerProtocol( "https", pr);
-
- config.setHost(host, port, pr);
+ */
+ BaseProtocolSocketFactory f = new BaseProtocolSocketFactory();
+
+ warn("Trusting all certificates");
+ // might as well trust the usual suspects:
+ //f.addTrustMaterial(TrustMaterial.CACERTS);
+ f.addTrustMaterial(TrustMaterial.TRUST_ALL);
+
+ // here's where we start trusting usertrust.com's CA:
+ //f.addTrustMaterial(new TrustMaterial(pemCert));
+
+ Protocol trustHttps = new Protocol("https", f, 443);
+ Protocol.registerProtocol("https", trustHttps);
+
+
+ config.setHost(host, port, trustHttps);
} else {
config.setHost(host, port);
@@ -131,4 +148,7 @@
}
*/
+ if (debug) {
+ debugMsg("uri set to " + config.getHostURL());
+ }
httpManager.getParams().setConnectionTimeout(timeOut);
@@ -296,4 +316,8 @@
}
+ protected void warn(String msg) {
+ getLogger().warn(msg);
+ }
+
protected void logIt(String msg) {
getLogger().info(msg);