Skip to content
Snippets Groups Projects
Commit 32a095a7 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

cert matching checks key and cert, not csr anymore

parent dbdaacf1
No related branches found
No related tags found
No related merge requests found
......@@ -106,19 +106,19 @@ function _certTransfer(){
# internal function; show md5 hashsums for certificate, csr and key
# for visual comparison if the match
function _certMatching(){
local md5_cert=$( openssl x509 -noout -modulus -in ${CM_outfile_cert} | openssl md5 | cut -f 2 -d " " )
local md5_csr=$( openssl req -noout -modulus -in ${CM_filecsr} | openssl md5 | cut -f 2 -d " " )
local md5_key=$( openssl rsa -noout -modulus -in ${CM_outfile_key} | openssl md5 | cut -f 2 -d " " )
local md5_csr=$( test -f ${CM_filecsr} & openssl req -noout -modulus -in ${CM_filecsr} | openssl md5 | cut -f 2 -d " " )
local md5_key=$( test -f ${CM_outfile_key} & openssl rsa -noout -modulus -in ${CM_outfile_key} | openssl md5 | cut -f 2 -d " " )
local md5_cert=$( test -f ${CM_outfile_cert} & openssl x509 -noout -modulus -in ${CM_outfile_cert} | openssl md5 | cut -f 2 -d " " )
echo
echo "--- compare hashes"
echo "cert : $md5_cert"
echo "csr : $md5_csr"
echo "csr : $md5_csr (used for creation of cert)"
echo "key : $md5_key"
if [ "$md5_key" = "$md5_cert" -a "$md5_key" = "$md5_csr" ]; then
echo "OK, they match :-)"
echo "cert : $md5_cert"
if [ "$md5_key" = "$md5_cert" ]; then
echo "OK, key and cert match :-)"
else
echo "ERROR: they do NOT MATCH!"
echo "ERROR: key and cert do NOT MATCH!"
fi
echo
}
......@@ -192,11 +192,11 @@ function _requiresFqdn(){
function _testStaging(){
echo $ACME_Params | grep "\-\-staging" >/dev/null
if [ $? -eq 0 ]; then
_wd "Using LE STAGE environment ..."
_wd "Using Let's Encrypt STAGE environment ..."
_wd "You can test and mess around. Do not use certs in production."
else
_wd "Using LE LIVE environment for production."
_wd "Be careful with count of connects to LE servers."
_wd "Using Let's Encrypt LIVE environment for production."
_wd "Be careful with count of connects to Let's Encrypt servers."
fi
echo
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment