@@ -70,35 +70,21 @@ windows_rdp_deploy() {
7070 fi
7171 _pfx_pass=" acme"
7272
73- # ---- build PFX + thumbprint locally ------------------------------------
74- _pfx_file=" $( _mktemp) "
75-
76- _debug " Building PFX at $_pfx_file "
77- # Use `-certfile "$_cfullchain"` if the entire certificate chain
78- # shall be included into the pkcs12 container. This should not
79- # be necessary usually, since the certificates are likely in
80- # the trust stores of the machines anyways, but we have the option
81- # if we should need to in the future.
82- if ! ${ACME_OPENSSL_BIN:- openssl} pkcs12 -export \
83- -inkey " $_ckey " -in " $_ccert " \
84- -name " acme.sh ${_cdomain} " \
85- -passout " pass:$_pfx_pass " \
86- -out " $_pfx_file " ; then
87- _err " Failed to build PFX archive."
88- rm -f " $_pfx_file "
89- return 1
90- fi
91-
92- # openssl prints "SHA1 Fingerprint=AA:BB:CC:..."; strip prefix and colons.
93- _thumb=" $( ${ACME_OPENSSL_BIN:- openssl} x509 -in " $_ccert " -noout -fingerprint -sha1 |
94- sed ' s/.*=//; s/://g' ) "
73+ # ---- build thumbprint + PFX locally ------------------------------------
74+ _thumb=" $( _fingerprint " $_ccert " ' sha1' ) "
9575 if [ -z " $_thumb " ]; then
9676 _err " Failed to compute certificate thumbprint."
97- rm -f " $_pfx_file "
9877 return 1
9978 fi
10079 _debug " Thumbprint: $_thumb "
10180
81+ _debug " Building PFX at $_pfx_file "
82+ _pfx_file=" $( _mktemp) "
83+ if ! _toPkcs " $_pfx_file " " $_ckey " " $_ccert " " $_cca " " $_pfx_pass " ; then
84+ _err " Failed to build PFX archive."
85+ rm -f " $_pfx_file "
86+ return 1
87+ fi
10288 _pfx_b64=$( _base64 " multiline" < " $_pfx_file " )
10389 rm -f " $_pfx_file "
10490
0 commit comments