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