Skip to content

Commit 30a1001

Browse files
committed
fix: SSL certificate verification issue
Error message as follows: > error: certificate verify failed (unable to get certificate CRL)
1 parent c3fd7b7 commit 30a1001

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

script/init_environment.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ pre-flight() {
1111
# Installing git package
1212
pacman -S --noconfirm git
1313

14-
# Installing ca-certificates package to avoid SSL issues
15-
pacman -S --noconfirm ca-certificates
16-
update-ca-trust
17-
1814
# Installing openssh package
1915
if [[ -n "${SSH_PRIVATE_KEY}" ]]; then
2016
pacman -S --noconfirm openssh
@@ -58,6 +54,19 @@ init_ruby() {
5854

5955
# debug
6056
ruby -v && bundle version
57+
58+
# OpenSSL 3.6 broke Ruby's OpenSSL bindings, see: https://github.com/ruby/openssl/issues/949
59+
# By using the openssl gem, we can pick up the fixes without needing to upgrade Ruby.
60+
# Find the Gemfile directory by emulating `bundle init` behavior
61+
GEMFILE_DIR=${JEKYLL_SRC};
62+
while [ "$GEMFILE_DIR" != "/" ]; do
63+
[ -f "$GEMFILE_DIR/Gemfile" ] && break
64+
GEMFILE_DIR=$(dirname "$GEMFILE_DIR")
65+
done
66+
if [ -f "$GEMFILE_DIR/Gemfile" ]; then
67+
echo "Adding openssl gem to Gemfile to fix compatibility with OpenSSL 3.6+"
68+
echo "gem 'openssl', '~> 3.3'" >> $GEMFILE_DIR/Gemfile
69+
fi
6170
}
6271

6372
pre-flight && init_ruby

0 commit comments

Comments
 (0)