Skip to content

Instantly share code, notes, and snippets.

@id
Created March 3, 2015 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save id/408b45ee8146fe578cda to your computer and use it in GitHub Desktop.
Save id/408b45ee8146fe578cda to your computer and use it in GitHub Desktop.
Adding CA into boot2docker vm
osx-host$ boot2docker ssh
sudo su -
cd /var/lib/boot2docker/
cat <<EOF >bootlocal.sh
#!/bin/sh
cp /Users/ivan.dyachkov/MyCA.crt /usr/local/share/ca-certificates/
CERT=/usr/local/share/ca-certificates/MyCA.crt
HASH=$(openssl x509 -hash -in $CERT | head -n1)
ln -s $CERT /etc/ssl/certs/$HASH.0
grep -q $(head -2 $CERT | tail -1) /etc/ssl/certs/ca-certificates.crt || cat $CERT >> /etc/ssl/certs/ca-certificates.crt
EOF
chmod +x bootlocal.sh
@id
Copy link
Author

id commented Mar 3, 2015

Replace MyCa.crt and "ivan.dyachkov" with your data.

@id
Copy link
Author

id commented Mar 3, 2015

This will survive boot2docker VM restart, however, you'll have to repeat this after recreating vm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment