Let's Encrypt script from Directadmin fails with OpenSSL 1.1.0

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,366
Location
www.poralix.com
Hello,

Let's Encrypt script from Directadmin fails with OpenSSL 1.1.0 with the error:

Code:
Invalid command 'sha'; type "help" for a list.

OpenSSL 1.1.0:

Code:
# /usr/bin/openssl help 2>&1 | grep sha
md5               mdc2              rmd160            sha1
sha224            sha256            sha384            sha512

has no sha command.

OpenSSL 1.0.2:

Code:
# /usr/local/ssl/bin/openssl help 2>&1 | grep sha
sha               sha1


Could you please add a check of OpenSSL version to adjust command depending on OpenSSL version?

Working with OpenSSL 1.1.0:

Code:
THUMBPRINT=`echo -n "${FOR_THUMBPRINT}" | tr -d ' ' | ${OPENSSL} sha256 -binary | base64_encode`
 
Thanks, I've added 1.0.6, but not yet in CustomBuild versions.txt:
http://files1.directadmin.com/services/all/letsencrypt.sh.1.0.6

I'll do some testing first, but any other testing welcome.
Thanks!

New code:
Code:
HAS_SHA_256=`${OPENSSL} help 2>&1 | grep -c sha256`
if [ "${HAS_SHA_256}" -gt 0 ]; then
    THUMBPRINT=`echo -n "${FOR_THUMBPRINT}" | tr -d ' ' | ${OPENSSL} sha256 -binary | base64_encode`
else
    THUMBPRINT=`echo -n "${FOR_THUMBPRINT}" | tr -d ' ' | ${OPENSSL} sha -sha256 -binary | base64_encode`
fi

John
 
versions.txt does have 1.0.6 but the file that get downloaded is still 1.0.5 (because CB looks for the .sh file withotu .1.0.6), missing symlink?

Best regards
 
versions.txt does have 1.0.6 but the file that get downloaded is still 1.0.5 (because CB looks for the .sh file withotu .1.0.6), missing symlink?

Best regards

You can do it this way for now.
Code:
cd /usr/local/directadmin/scripts/
wget [url]http://files1.directadmin.com/services/all/letsencrypt.sh.1.0.6[/url] -O letsencrypt.sh
chmod 755 letsencrypt.sh
 
Back
Top