File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,19 @@ runs:
3232 KEYCHAIN_PATH="/Users/$(whoami)/Library/Keychains/${KEYCHAIN_NAME}"
3333 KEYCHAIN_DB_PATH="${KEYCHAIN_PATH}-db"
3434 if [ -z "$CERTIFICATE_PASSWORD" ]; then
35- echo "The password for the certificate cannot be empty."
35+ echo "::error:: The password for the certificate cannot be empty."
3636 exit 1
3737 fi
3838 op read --out-file $CERTIFICATE_FILE_PATH "${{ inputs.certificate-op-reference }}"
3939 CERTIFICATE_PEM_PATH=$(mktemp)
40- if ! openssl pkcs12 -in "$CERTIFICATE_FILE_PATH" -clcerts -nokeys -passin pass:"$CERTIFICATE_PASSWORD" -out "$CERTIFICATE_PEM_PATH" >/dev/null 2>&1; then
41- echo "Failed to read certificate file. Check that the certificate and password are correct."
40+ OPENSSL_VERSION=$(openssl version)
41+ if echo "$OPENSSL_VERSION" | grep -qE 'OpenSSL 3'; then
42+ OPENSSL_PKCS12_FLAGS="-legacy"
43+ else
44+ OPENSSL_PKCS12_FLAGS=""
45+ fi
46+ if ! openssl pkcs12 $OPENSSL_PKCS12_FLAGS -in "$CERTIFICATE_FILE_PATH" -clcerts -nokeys -passin pass:"$CERTIFICATE_PASSWORD" -out "$CERTIFICATE_PEM_PATH" 2>&1; then
47+ echo "::error::Failed to read certificate file. Check that the certificate and password are correct."
4248 rm -f "$CERTIFICATE_PEM_PATH"
4349 exit 1
4450 fi
You can’t perform that action at this time.
0 commit comments