Skip to content

Commit 6432852

Browse files
make DEFAULT_CERT_STORE frozen and shareable
1 parent 7ab64d7 commit 6432852

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/openssl/ssl.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ class SSLContext
9090
)
9191
end
9292

93-
DEFAULT_CERT_STORE = OpenSSL::X509::Store.new # :nodoc:
94-
DEFAULT_CERT_STORE.set_default_paths
95-
DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
93+
DEFAULT_CERT_STORE = OpenSSL::X509::Store.new.tap do |store| # :nodoc:
94+
store.set_default_paths
95+
store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
96+
store.freeze
97+
end
9698

9799
# A callback invoked when DH parameters are required for ephemeral DH key
98100
# exchange.

0 commit comments

Comments
 (0)