Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
ri
/
2.1.0
/
system
/
OpenSSL
/
X509
/
StoreContext
/
//opt/alt/ruby21/share/ri/2.1.0/system/OpenSSL/X509/StoreContext/cdesc-StoreContext.ri
U:RDoc::NormalClass[iI"StoreContext:ETI" OpenSSL::X509::StoreContext;TI"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I")Document-class: OpenSSL::X509::Store;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim;[#I"MThe X509 certificate store holds trusted CA certificates used to verify ;TI"peer certificates. ;TI" ;TI">The easiest way to create a useful certificate store is: ;TI" ;TI"- cert_store = OpenSSL::X509::Store.new ;TI"$ cert_store.set_default_paths ;TI" ;TI"8This will use your system's built-in certificates. ;TI" ;TI"HIf your system does not have a default set of certificates you can ;TI"Mobtain a set from Mozilla here: http://curl.haxx.se/docs/caextract.html ;TI"K(Note that this set does not have an HTTPS download option so you may ;TI"Jwish to use the firefox-db2pem.sh script to extract the certificates ;TI"?from a local install to avoid man-in-the-middle attacks.) ;TI" ;TI"JAfter downloading or generating a cacert.pem from the above link you ;TI"Acan create a certificate store from the pem file like this: ;TI" ;TI"- cert_store = OpenSSL::X509::Store.new ;TI"( cert_store.add_file 'cacert.pem' ;TI" ;TI"DThe certificate store can be used with an SSLSocket like this: ;TI" ;TI"2 ssl_context = OpenSSL::SSL::SSLContext.new ;TI"+ ssl_context.cert_store = cert_store ;TI" ;TI"6 tcp_socket = TCPSocket.open 'example.com', 443 ;TI" ;TI"G ssl_socket = OpenSSL::SSL::SSLSocket.new tcp_socket, ssl_context;T:@format0: @fileI"!ext/openssl/ossl_x509store.c;T:0@omit_headings_from_table_of_contents_below0; 0;0[ [ [ [[I" class;T[[:public[ [:protected[ [:private[ [I" instance;T[[;[ [;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0;0[I"$ext/openssl/lib/openssl/x509.rb;TI"#ext/openssl/ossl_ssl_session.c;TI"OpenSSL::X509;TcRDoc::NormalModule