Class: Yeller::SecureServer

Inherits:
Struct
  • Object
show all
Defined in:
lib/yeller/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostObject

Returns the value of attribute host

Returns:

  • (Object)

    the current value of host



9
10
11
# File 'lib/yeller/server.rb', line 9

def host
  @host
end

#portObject

Returns the value of attribute port

Returns:

  • (Object)

    the current value of port



9
10
11
# File 'lib/yeller/server.rb', line 9

def port
  @port
end

Instance Method Details

#clientObject



10
11
12
# File 'lib/yeller/server.rb', line 10

def client
  @client ||= setup_client
end

#setup_clientObject



14
15
16
17
18
19
20
21
22
# File 'lib/yeller/server.rb', line 14

def setup_client
  http = Net::HTTP.new(host, port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
  if http.respond_to?(:ciphers=)
    http.ciphers = "DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2"
  end
  http
end