From 6c5db5949c07aecf3c0fb81afa3fc80fe8787116 Mon Sep 17 00:00:00 2001 From: Stephen Clayton Date: Thu, 3 Aug 2017 16:16:36 +0200 Subject: [PATCH] update README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 9c8dab9..bd59d53 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,25 @@ # clj-util-webdav This allows interaction with WebDAV enabled document stores using the sardine library. + +To test using https with a self signed certificate: + +```bash + +tee test-resources/webdav.properties > /dev/null << EOF +base-url = https://foo.shh.mpg.de/dav +user-name = cat +password = hat +test.dav-prefix = dav/ +EOF + +# On mac find JAVA_HOME using +# /usr/libexec/java_home +# copy our java trust store and add our self signed cert +cp /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/security/cacerts . +#echo -n | openssl s_client -connect foo.shh.mpg.de:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > foo.crt +# The above fails becuase this server has multiple identities (i.e. the first is bar-foo.mpg.shh.de but we want foo.shh.mpg.de) +echo -n | openssl s_client -connect foo.shh.mpg.de:443 -servername foo.shh.mpg.de | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > foo.crt +keytool -import -keystore cacerts -trustcacerts -storepass changeit -noprompt -alias foo -file foo.crt +# test using our trust store copy with our self signed cert installed +JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStore=cacerts" lein test +```