Class: SSLyze::XML::Certinfo::CertificateValidation::HostnameValidation

Inherits:
Object
  • Object
show all
Includes:
Types
Defined in:
lib/sslyze/xml/certinfo/certificate_validation/hostname_validation.rb

Overview

Represents the <hostnameValidation> XML element.

Since:

  • 1.0.0

Constant Summary

Constants included from Types

Types::Boolean, Types::None

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ HostnameValidation

Initializes the element.

Parameters:

  • node (Nokogiri::XML::Element)

    The <hostnameValidation> XML element.

Since:

  • 1.0.0



23
24
25
# File 'lib/sslyze/xml/certinfo/certificate_validation/hostname_validation.rb', line 23

def initialize(node)
  @node = node
end

Instance Method Details

#certificate_matches_server_hostname?Boolean Also known as: matches_server_hostname?

Determines if the certificate Common Name matches the target domain name.

Returns:

Since:

  • 1.0.0



33
34
35
# File 'lib/sslyze/xml/certinfo/certificate_validation/hostname_validation.rb', line 33

def certificate_matches_server_hostname?
  Boolean[@node['certificateMatchesServerHostname']]
end

#server_hostnameString Also known as: to_s

The server's domain name.

Returns:

  • (String)

Since:

  • 1.0.0



44
45
46
# File 'lib/sslyze/xml/certinfo/certificate_validation/hostname_validation.rb', line 44

def server_hostname
  @node['serverHostname']
end