Skip to content

Instantly share code, notes, and snippets.

@tknerr
Created May 29, 2015 13:45
Show Gist options
  • Save tknerr/0d747b6320340a4e515a to your computer and use it in GitHub Desktop.
Save tknerr/0d747b6320340a4e515a to your computer and use it in GitHub Desktop.
Generating new client key in boot2docker from a Windows host
:: see https://docs.docker.com/articles/https/
set LIBDIR=/var/lib/boot2docker/tls
b2d ssh -- sudo openssl genrsa -out %LIBDIR%/localhost_key.pem 2048
b2d ssh -- sudo OPENSSL_CONF=/usr/local/etc/ssl/openssl.cnf openssl req -subj '/CN=client' -new -key %LIBDIR%/localhost_key.pem -out %LIBDIR%/localhost_client.csr
b2d ssh -- echo extendedKeyUsage = clientAuth ^| sudo tee %LIBDIR%/localhost_extfile.cnf
b2d ssh -- sudo openssl x509 -req -days 365 -in %LIBDIR%/localhost_client.csr -CA %LIBDIR%/ca.pem -CAkey %LIBDIR%/cakey.pem -CAcreateserial -out %LIBDIR%/localhost_cert.pem -extfile %LIBDIR%/localhost_extfile.cnf
b2d ssh -- sudo rm %LIBDIR%/localhost_client.csr %LIBDIR%/localhost_extfile.cnf
b2d ssh -- sudo cat %LIBDIR%/localhost_key.pem > %HOME%\.boot2docker\certs\boot2docker-vm\localhost_key.pem
b2d ssh -- sudo cat %LIBDIR%/localhost_cert.pem > %HOME%\.boot2docker\certs\boot2docker-vm\localhost_cert.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment