summaryrefslogtreecommitdiff
path: root/sample/openssl/certstore.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2021-02-25 16:49:11 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-03-16 19:37:06 +0900
commite35d3623de47b1a8d699f431460fbcba36de84f2 (patch)
treeea4c2e2e6a9911e52b9ba16a2efd58e5259ba7d8 /sample/openssl/certstore.rb
parenta3f97007bbd1012a4b7662b8166118b81b52527a (diff)
[ruby/openssl] sample: avoid "include OpenSSL"
It is not a common practice and should not be done since it causes name clash: for example, Digest and Random are provided by other standard libraries of Ruby. Fixes: https://github.com/ruby/openssl/issues/419 https://github.com/ruby/openssl/commit/6a6444984b
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4275
Diffstat (limited to 'sample/openssl/certstore.rb')
-rw-r--r--sample/openssl/certstore.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/sample/openssl/certstore.rb b/sample/openssl/certstore.rb
index c6e8f816bcd..72e59f6dad0 100644
--- a/sample/openssl/certstore.rb
+++ b/sample/openssl/certstore.rb
@@ -3,9 +3,6 @@ require 'crlstore'
class CertStore
- include OpenSSL
- include X509
-
attr_reader :self_signed_ca
attr_reader :other_ca
attr_reader :ee
@@ -17,11 +14,11 @@ class CertStore
@c_store = CHashDir.new(@certs_dir)
@c_store.hash_dir(true)
@crl_store = CrlStore.new(@c_store)
- @x509store = Store.new
+ @x509store = OpenSSL::X509::Store.new
@self_signed_ca = @other_ca = @ee = @crl = nil
# Uncomment this line to let OpenSSL to check CRL for each certs.
- # @x509store.flags = V_FLAG_CRL_CHECK | V_FLAG_CRL_CHECK_ALL
+ # @x509store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK | OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
add_path
scan_certs