Sha256: 7cb60df9b5c3be9e3e2900488ef0c26c0d610d1026ff31a0c2846f4a5c94c235

Contents?: true

Size: 518 Bytes

Versions: 2

Compression:

Stored size: 518 Bytes

Contents

require 'infrataster'
require 'net/https'

module Infrataster
  module Contexts
    class SslCertificatesContext < BaseContext
      def certificate
        options = { port: 443 }

        if server.options[:ssl]
          options = options.merge(server.options[:ssl])
        end

        https = Net::HTTP.new(resource.domain, options[:port])
        https.use_ssl = true
        https.verify_mode = OpenSSL::SSL::VERIFY_PEER
        https.start do
          https.peer_cert
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
infrataster-plugin-ssl_certificates-0.0.3 lib/infrataster/contexts/ssl_certificates_context.rb
infrataster-plugin-ssl_certificates-0.0.2 lib/infrataster/contexts/ssl_certificates_context.rb