Skip to content

Commit 82be834

Browse files
authored
Merge pull request #2576 from mikelolasagasti/droppingOfCertPemFile
Support RHEL 9+/Fedora 34+ CA bundle path
2 parents 2b0f711 + cb14920 commit 82be834

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

bin/ruby-build

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,11 @@ build_package_openssl() {
12941294
# Extract root certs from the system keychain in .pem format.
12951295
security find-certificate -a -p /Library/Keychains/System.keychain > "$pem_file"
12961296
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$pem_file"
1297+
elif [ -e /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem ]; then # RHEL 9+, Fedora 34+
1298+
# See https://fedoraproject.org/wiki/Changes/droppingOfCertPemFile
1299+
rm -rf "$OPENSSLDIR/certs" "$pem_file"
1300+
ln -s /etc/pki/ca-trust/extracted/pem/ "$OPENSSLDIR/certs"
1301+
ln -s /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem "$pem_file"
12971302
elif [ -e /etc/pki/tls/cert.pem ]; then # RedHat
12981303
# See https://github.com/rubygems/rubygems/issues/2415#issuecomment-509806259
12991304
rm -rf "$OPENSSLDIR/certs" "$pem_file"
@@ -1313,7 +1318,10 @@ build_package_openssl() {
13131318
ln -snf "$SYSTEM_OPENSSLDIR/certs" "$OPENSSLDIR/certs"
13141319
fi
13151320
else
1316-
echo "Could not find OpenSSL certificates" >&2
1321+
{ colorize 1 "ERROR"
1322+
echo "Could not find OpenSSL certificates on this system."
1323+
echo "You may need to install the 'ca-certificates' package or 'openssl' for your distribution."
1324+
} >&2
13171325
exit 1
13181326
fi
13191327
}

0 commit comments

Comments
 (0)