File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,21 +14,21 @@ openssl s_client -connect "$SERVER:$PORT" -showcerts </dev/null 2>/dev/null | op
1414
1515# Check certificate hashes to prevent man-in-the-middle attacks
1616DOWNLOADED_HASH=$( sha256sum /tmp/server_cert.pem | cut -d ' ' -f 1)
17- if [[ ! -v CERT_SHA256_HASH ]]; then
18- printf " No certificate hash provided as environment variable CERT_SHA256_HASH \n"
17+ if [[ ! -v SERVER_CERT_SHA256_HASH ]]; then
18+ printf " No certificate hash provided as environment variable SERVER_CERT_SHA256_HASH \n"
1919 printf " This is unsafe! If you want to trust this server certificate, add this hash\n"
2020 printf " into this container's environment:\n"
2121 printf " %s\n" " $DOWNLOADED_HASH "
2222 exit 1
2323fi
2424
25- if ! printf " %s /tmp/server_cert.pem\n" " $CERT_SHA256_HASH " | sha1sum --check --status; then
25+ if ! printf " %s /tmp/server_cert.pem\n" " $SERVER_CERT_SHA256_HASH " | sha1sum --check --status; then
2626 printf " Certificate hash failed! The downloaded server certificate has hash:\n"
2727 printf " %s\n" " $DOWNLOADED_HASH "
2828 printf " but this does not match the provided one:"
2929 printf " %s\n" " $CERT_SHA256_HASH "
30- printf " Update the container environment\n"
31- printf " variable CERT_SHA256_HASH if you know that the certificate changed!"
30+ printf " Update the container environment variable SERVER_CERT_SHA256_HASH \n"
31+ printf " if you know that the certificate changed!\n "
3232 exit 1
3333fi
3434
You can’t perform that action at this time.
0 commit comments