diff --git a/src/current/README_SSL_FIX.md b/src/current/README_SSL_FIX.md new file mode 100644 index 00000000000..a8547146a6e --- /dev/null +++ b/src/current/README_SSL_FIX.md @@ -0,0 +1,17 @@ +# SSL Fix for Jekyll Build + +If you encounter SSL certificate verification errors when running Jekyll builds, you can use the provided `openssl_fix.rb` script as a workaround. + +## Usage + +Run the Jekyll build with the `RUBYOPT` environment variable: + +```bash +RUBYOPT="-r./openssl_fix.rb" bundle exec jekyll build --incremental --config _config_base.yml,_config_cockroachdb.yml +``` + +## What it does + +This script disables SSL certificate verification for Ruby's OpenSSL library. It's intended as a temporary workaround for local development environments where SSL certificate issues may occur. + +⚠️ **Warning**: This script disables SSL verification and should only be used in local development environments. Do not use in production. diff --git a/src/current/openssl_fix.rb b/src/current/openssl_fix.rb new file mode 100644 index 00000000000..3f9c15165f3 --- /dev/null +++ b/src/current/openssl_fix.rb @@ -0,0 +1,27 @@ +require "openssl" +require "net/http" + +# Monkey patch to completely disable SSL verification +module OpenSSL + module SSL + remove_const :VERIFY_PEER + VERIFY_PEER = VERIFY_NONE + end +end + +# Override Net::HTTP SSL context creation +class Net::HTTP + alias_method :original_use_ssl=, :use_ssl= + + def use_ssl=(flag) + self.original_use_ssl = flag + if flag + @ssl_context = OpenSSL::SSL::SSLContext.new + @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE + @ssl_context.verify_hostname = false + end + end +end + +# Set environment variable as fallback +ENV['SSL_VERIFY'] = 'false'