Class: Ddig::Ddr::VerifyCert
- Inherits:
-
Object
- Object
- Ddig::Ddr::VerifyCert
- Defined in:
- lib/ddig/ddr/verify_cert.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#subject_alt_name ⇒ Object
readonly
Returns the value of attribute subject_alt_name.
-
#unencrypted_resolver ⇒ Object
readonly
Returns the value of attribute unencrypted_resolver.
-
#verify ⇒ Object
readonly
Returns the value of attribute verify.
Instance Method Summary collapse
-
#initialize(hostname:, address:, port:, unencrypted_resolver:) ⇒ VerifyCert
constructor
A new instance of VerifyCert.
- #set_subject_alt_name(ssl_socket) ⇒ Object
Constructor Details
#initialize(hostname:, address:, port:, unencrypted_resolver:) ⇒ VerifyCert
Returns a new instance of VerifyCert.
10 11 12 13 14 15 16 17 |
# File 'lib/ddig/ddr/verify_cert.rb', line 10 def initialize(hostname:, address:, port:, unencrypted_resolver:) @hostname = hostname @address = address @port = port @unencrypted_resolver = unencrypted_resolver @open_timeout = 3 end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
7 8 9 |
# File 'lib/ddig/ddr/verify_cert.rb', line 7 def address @address end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
8 9 10 |
# File 'lib/ddig/ddr/verify_cert.rb', line 8 def @error_message end |
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
7 8 9 |
# File 'lib/ddig/ddr/verify_cert.rb', line 7 def hostname @hostname end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
7 8 9 |
# File 'lib/ddig/ddr/verify_cert.rb', line 7 def port @port end |
#subject_alt_name ⇒ Object (readonly)
Returns the value of attribute subject_alt_name.
8 9 10 |
# File 'lib/ddig/ddr/verify_cert.rb', line 8 def subject_alt_name @subject_alt_name end |
#unencrypted_resolver ⇒ Object (readonly)
Returns the value of attribute unencrypted_resolver.
7 8 9 |
# File 'lib/ddig/ddr/verify_cert.rb', line 7 def unencrypted_resolver @unencrypted_resolver end |
#verify ⇒ Object (readonly)
Returns the value of attribute verify.
8 9 10 |
# File 'lib/ddig/ddr/verify_cert.rb', line 8 def verify @verify end |
Instance Method Details
#set_subject_alt_name(ssl_socket) ⇒ Object
61 62 63 64 65 |
# File 'lib/ddig/ddr/verify_cert.rb', line 61 def set_subject_alt_name(ssl_socket) socket = Net::BufferedIO.new(ssl_socket) @subject_alt_name = socket.io.peer_cert.extensions.select { |ext| ext.to_h['oid'] == 'subjectAltName' }.first.to_h['value'].split(', ') end |