Skip to content

Commit c17e5a7

Browse files
committed
Fix some certificate checking issues with openssl 3.6.0
[skip ci]
1 parent 2cb4808 commit c17e5a7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

script/github_pr_errors

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ elsif !ENV["GITHUB_TOKEN"]
2828
raise "Missing GITHUB_TOKEN env, go to https://github.com/settings/tokens and create one with 'repo' access"
2929
end
3030

31+
# workaround an openssl 3.6.0 issue
32+
# https://github.com/ruby/openssl/issues/949#issuecomment-3367944960
33+
s = OpenSSL::X509::Store.new.tap(&:set_default_paths)
34+
OpenSSL::SSL::SSLContext.send(:remove_const, :DEFAULT_CERT_STORE) rescue nil # rubocop:disable Style/RescueModifier
35+
OpenSSL::SSL::SSLContext.const_set(:DEFAULT_CERT_STORE, s.freeze)
36+
3137
class Options
3238
DEFAULTS = {
3339
compact: false,
@@ -183,8 +189,8 @@ def get_http(path)
183189

184190
response = http.get(url)
185191

186-
say_verbose("HTTP Response #{response.status}")
187192
response.raise_for_status
193+
say_verbose("HTTP Response #{response.status}")
188194
response.to_s
189195
rescue HTTPX::HTTPError => e
190196
warn error_details(e)

0 commit comments

Comments
 (0)