1
0
Fork 0

Use a pregenerated dhparam.pem for tests

Letting the LE container generate its 2048 bits dhparam can consume up
to five minutes.
This commit is contained in:
Nicolas Duchon 2017-12-01 00:12:38 +01:00
parent c6eead0b44
commit 3d1ee4ee0b
No known key found for this signature in database
GPG Key ID: 91EF7BB1EECB961A
3 changed files with 12 additions and 18 deletions

8
test/setup/dhparam.pem Normal file
View File

@ -0,0 +1,8 @@
-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEAzB2nIGzpVq7afJnKBm1X0d64avwOlP2oneiKwxRHdDI/5+6TpH1P
F8ipodGuZBUMmupoB3D34pu2Qq5boNW983sm18ww9LMz2i/pxhSdB+mYAew+A6h6
ltQ5pNtyn4NaKw1SDFkqvde3GNPhaWoPDbZDJhpHGblR3w1b/ag+lTLZUvVwcD8L
jYS9f9YWAC6T7WxAxh4zvu1Z0I1EKde8KYBxrreZNheXpXHqMNyJYZCaY2Hb/4oI
EL65qZq1GCWezpWMjhk6pOnV5gbvqfhoazCv/4OdRv6RoWOIYBNs9BmGho4AtXqV
FYLdYDhOvN4aVs9Ir+G8ouwiRnix24+UewIBAg==
-----END DH PARAMETERS-----

View File

@ -39,3 +39,7 @@ case $SETUP in
exit 1
esac
docker run --name helper --volumes-from $NGINX_CONTAINER_NAME busybox true
docker cp ${TRAVIS_BUILD_DIR}/test/setup/dhparam.pem helper:/etc/nginx/certs
docker rm -f helper

View File

@ -24,24 +24,6 @@ function run_le_container {
}
export -f run_le_container
# Wait for the /etc/nginx/certs/dhparam.pem file to exist in container $1
function wait_for_dhparam {
local name="${1:?}"
local i=0
sleep 1
echo -n "Waiting for the $name container to generate a DH parameters file, this might take a while..."
until docker exec "$name" [ -f /etc/nginx/certs/dhparam.pem ]; do
if [ $i -gt 600 ]; then
echo "DH parameters file was not generated under ten minutes by the $name container, timing out."
exit 1
fi
i=$((i + 5))
sleep 5
done
echo "Done."
}
export -f wait_for_dhparam
# Wait for the /etc/nginx/certs/$1/cert.pem file to exist inside container $2
function wait_for_cert {
local domain="${1:?}"