Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ $ docker run -d \
* No value (empty, not set): no change in behavior.
* `ecs` [Amazon ECS using ECS_CONTAINER_METADATA_FILE environment variable](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-metadata.html)

* `DHPARAM_BITS` - Change the size of the Diffie-Hellman key generated by the container from the default value of 2048 bits. For example `-e DHPARAM_BITS=1024` to support some older clients like Java 6 and 7.

#### Examples:

If you want other examples how to use this container, look at:
Expand Down
8 changes: 7 additions & 1 deletion app/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,15 @@ function check_writable_directory {
}

function check_dh_group {
local DHPARAM_BITS="${DHPARAM_BITS:-2048}"
re='^[0-9]*$'
if ! [[ "$DHPARAM_BITS" =~ $re ]] ; then
echo "Error: invalid Diffie-Hellman size of $DHPARAM_BITS !" >&2
exit 1
fi
if [[ ! -f /etc/nginx/certs/dhparam.pem ]]; then
echo "Creating Diffie-Hellman group (can take several minutes...)"
openssl dhparam -out /etc/nginx/certs/.dhparam.pem.tmp 2048
openssl dhparam -out /etc/nginx/certs/.dhparam.pem.tmp $DHPARAM_BITS
mv /etc/nginx/certs/.dhparam.pem.tmp /etc/nginx/certs/dhparam.pem || exit 1
fi
}
Expand Down