Class: SSLyze::XML::Protocol
- Includes:
- Types
- Defined in:
- lib/sslyze/xml/protocol.rb,
lib/sslyze/xml/protocol/cipher_suite.rb,
lib/sslyze/xml/protocol/cipher_suite/key_exchange.rb
Overview
Represents the <sslv2>
, <sslv3>
, <tls1>
, <tls1_1>
, <tlsv1_2>
XML elements.
Defined Under Namespace
Classes: CipherSuite
Constant Summary
Constants included from Types
Instance Attribute Summary collapse
-
#name ⇒ Symbol
readonly
SSL protocol name.
Instance Method Summary collapse
-
#accepted_cipher_suites ⇒ Array<CipherSuite>
The accepted cipher suites.
-
#each_accepted_cipher_suite {|cipher_suite| ... } ⇒ Enumerator
Enumerates over every accepted cipher suite.
-
#each_error {|cipher_suite| ... } ⇒ Enumerator
Enumerates over every errored cipher suite.
-
#each_rejected_cipher_suite {|cipher_suite| ... } ⇒ Enumerator
Enumerates over every rejected cipher suite.
-
#errors ⇒ Array<CipherSuite>
The errored cipher suites.
-
#initialize(node) ⇒ Protocol
constructor
Initializes the protocol.
-
#is_protocol_supported? ⇒ Boolean
(also: #is_supported?, #supported?)
Determines whether the protocol is supported.
-
#preferred_cipher_suite ⇒ CipherSuite?
The preferred cipher suite.
-
#rejected_cipher_suites ⇒ Array<CipherSuite>
The rejected cipher suites.
Methods included from Attributes::Exception
Methods included from Attributes::Title
Constructor Details
#initialize(node) ⇒ Protocol
Initializes the protocol.
26 27 28 29 |
# File 'lib/sslyze/xml/protocol.rb', line 26 def initialize(node) @node = node @name = @node.name.to_sym end |
Instance Attribute Details
#name ⇒ Symbol (readonly)
SSL protocol name.
18 19 20 |
# File 'lib/sslyze/xml/protocol.rb', line 18 def name @name end |
Instance Method Details
#accepted_cipher_suites ⇒ Array<CipherSuite>
The accepted cipher suites.
94 95 96 |
# File 'lib/sslyze/xml/protocol.rb', line 94 def accepted_cipher_suites each_accepted_cipher_suite.to_a end |
#each_accepted_cipher_suite {|cipher_suite| ... } ⇒ Enumerator
Enumerates over every accepted cipher suite.
81 82 83 84 85 86 87 |
# File 'lib/sslyze/xml/protocol.rb', line 81 def each_accepted_cipher_suite return enum_for(__method__) unless block_given? @node.xpath('acceptedCipherSuites/cipherSuite').each do |cipher_suite| yield CipherSuite.new(cipher_suite) end end |
#each_error {|cipher_suite| ... } ⇒ Enumerator
Enumerates over every errored cipher suite.
122 123 124 125 126 127 128 |
# File 'lib/sslyze/xml/protocol.rb', line 122 def each_error return enum_for(__method__) unless block_given? @node.xpath('errors/cipherSuite').each do |cipher_suite| yield CipherSuite.new(cipher_suite) end end |
#each_rejected_cipher_suite {|cipher_suite| ... } ⇒ Enumerator
Enumerates over every rejected cipher suite.
55 56 57 58 59 60 61 |
# File 'lib/sslyze/xml/protocol.rb', line 55 def each_rejected_cipher_suite return enum_for(__method__) unless block_given? @node.xpath('rejectedCipherSuites/cipherSuite').each do |cipher_suite| yield CipherSuite.new(cipher_suite) end end |
#errors ⇒ Array<CipherSuite>
The errored cipher suites.
137 138 139 |
# File 'lib/sslyze/xml/protocol.rb', line 137 def errors each_error.to_a end |
#is_protocol_supported? ⇒ Boolean Also known as: is_supported?, supported?
Determines whether the protocol is supported.
39 40 41 |
# File 'lib/sslyze/xml/protocol.rb', line 39 def is_protocol_supported? Boolean[@node['isProtocolSupported']] end |
#preferred_cipher_suite ⇒ CipherSuite?
The preferred cipher suite.
105 106 107 108 109 |
# File 'lib/sslyze/xml/protocol.rb', line 105 def preferred_cipher_suite @preferred_cipher_suite ||= if (element = @node.at_xpath('preferredCipherSuite/cipherSuite')) CipherSuite.new(element) end end |
#rejected_cipher_suites ⇒ Array<CipherSuite>
The rejected cipher suites.
68 69 70 |
# File 'lib/sslyze/xml/protocol.rb', line 68 def rejected_cipher_suites each_rejected_cipher_suite.to_a end |