Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

clj-util-webdav

This allows interaction with WebDAV enabled document stores using the sardine library.

To test using https with a self signed certificate:

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.shh.mpg.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

I needed to find an implementation of javax.xml.bind as this is disapearing from the JDK. The one I found tries to use http repos to download jars as those versions are missing from maven central. To find the miscreants do:

lein pom
mvn dependency:tree -Dverbose=true | tee insecure.txt

# ^Note that this will actualy download them, so delete the following from you local repo, find different versions in maven central and exclude those deps in the project.clj

cat insecure.txt | grep "^Downloaded" | grep "http:" | cut -d ' ' -f 2