Skip to content

Commit 2dbaab0

Browse files
committed
Install openssl on Ruby <= 2.3 on Linux
* As distributions don't provide old openssl anymore or is inconvenient because it's needed to remove newer openssl to install ruby.
1 parent a9adec3 commit 2dbaab0

File tree

10 files changed

+20
-12
lines changed

10 files changed

+20
-12
lines changed

bin/ruby-build

+11-3
Original file line numberDiff line numberDiff line change
@@ -1063,10 +1063,18 @@ build_package_mac_openssl() {
10631063

10641064
build_package_standard "$@"
10651065

1066-
# Extract root certs from the system keychain in .pem format and rehash.
10671066
local pem_file="$OPENSSLDIR/cert.pem"
1068-
security find-certificate -a -p /Library/Keychains/System.keychain > "$pem_file"
1069-
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$pem_file"
1067+
if is_mac; then
1068+
# Extract root certs from the system keychain in .pem format and rehash.
1069+
security find-certificate -a -p /Library/Keychains/System.keychain > "$pem_file"
1070+
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$pem_file"
1071+
else
1072+
# See https://github.com/rubygems/rubygems/issues/2415#issuecomment-509806259
1073+
# Debian-based logic:
1074+
rm -rf "$OPENSSLDIR/certs" "$pem_file"
1075+
ln -s /etc/ssl/certs "$OPENSSLDIR"
1076+
ln -s /etc/ssl/certs/ca-certificates.crt "$pem_file"
1077+
fi
10701078
}
10711079

10721080
# Post-install check that the openssl extension was built.

share/ruby-build/2.3.0

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl
22
install_package "ruby-2.3.0" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2#ec7579eaba2e4c402a089dbc86c98e5f1f62507880fd800b9b34ca30166bfa5e" ldflags_dirs standard verify_openssl

share/ruby-build/2.3.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl
22
install_package "ruby-2.3.1" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2#4a7c5f52f205203ea0328ca8e1963a7a88cf1f7f0e246f857d595b209eac0a4d" ldflags_dirs standard verify_openssl

share/ruby-build/2.3.2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl
22
install_package "ruby-2.3.2" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.2.tar.bz2#e6ce83d46819c4120c9295ff6b36b90393dd5f6bef3bb117a06d7399c11fc7c0" ldflags_dirs standard verify_openssl

share/ruby-build/2.3.3

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl
22
install_package "ruby-2.3.3" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.bz2#882e6146ed26c6e78c02342835f5d46b86de95f0dc4e16543294bc656594cc5b" ldflags_dirs standard verify_openssl

share/ruby-build/2.3.4

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl
22
install_package "ruby-2.3.4" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.4.tar.bz2#cd9808bb53824d6edb58beaadd3906cb23b987438ce75ab7bb279b2229930e2f" ldflags_dirs standard verify_openssl

share/ruby-build/2.3.5

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl
22
install_package "ruby-2.3.5" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.5.tar.bz2#f71c4b67ba1bef424feba66774dc9d4bbe02375f5787e41596bc7f923739128b" ldflags_dirs standard verify_openssl

share/ruby-build/2.3.6

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl
22
install_package "ruby-2.3.6" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.bz2#07aa3ed3bffbfb97b6fc5296a86621e6bb5349c6f8e549bd0db7f61e3e210fd0" ldflags_dirs standard verify_openssl

share/ruby-build/2.3.7

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl
22
install_package "ruby-2.3.7" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.7.tar.bz2#18b12fafaf37d5f6c7139c1b445355aec76baa625a40300598a6c8597fc04d8e" ldflags_dirs standard verify_openssl

share/ruby-build/2.3.8

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2q" "https://www.openssl.org/source/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl
22
install_package "ruby-2.3.8" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2#4d1a3a88e8cf9aea624eb73843fbfc60a9a281582660f86d5e4e00870397407c" ldflags_dirs standard verify_openssl

0 commit comments

Comments
 (0)