123456789_123456789_123456789_123456789_123456789_

Class: Puma::MiniSSL::Context

Relationships & Source Files
Inherits: Object
Defined in: lib/puma/minissl.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newContext

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 208

def initialize
  @no_tlsv1   = false
  @no_tlsv1_1 = false
  @key = nil
  @cert = nil
  @key_pem = nil
  @cert_pem = nil
end

Instance Attribute Details

#ca (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 241

attr_reader :ca

#ca=(ca) (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 257

def ca=(ca)
  check_file ca, 'ca'
  @ca = ca
end

#cert (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 240

attr_reader :cert

#cert=(cert) (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 252

def cert=(cert)
  check_file cert, 'Cert'
  @cert = cert
end

#cert_pem (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 242

attr_reader :cert_pem

#cert_pem=(cert_pem) (rw)

Raises:

  • (ArgumentError)
[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 262

def cert_pem=(cert_pem)
  raise ArgumentError, "'cert_pem' is not a String" unless cert_pem.is_a? String
  @cert_pem = cert_pem
end

#key (rw)

non-jruby Context properties

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 239

attr_reader :key

#key=(key) (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 247

def key=(key)
  check_file key, 'Key'
  @key = key
end

#key_pem (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 243

attr_reader :key_pem

#key_pem=(key_pem) (rw)

Raises:

  • (ArgumentError)
[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 267

def key_pem=(key_pem)
  raise ArgumentError, "'key_pem' is not a String" unless key_pem.is_a? String
  @key_pem = key_pem
end

#keystore (rw)

jruby-specific Context properties: java uses a keystore and password pair rather than a cert/key pair

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 224

attr_reader :keystore

#keystore=(keystore) (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 228

def keystore=(keystore)
  check_file keystore, 'Keystore'
  @keystore = keystore
end

#keystore_pass (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 225

attr_accessor :keystore_pass

#no_tlsv1 (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 206

attr_reader :no_tlsv1, :no_tlsv1_1

#no_tlsv1=(tlsv1) (rw)

disables TLSv1

Raises:

  • (ArgumentError)
[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 280

def no_tlsv1=(tlsv1)
  raise ArgumentError, "Invalid value of no_tlsv1=" unless ['true', 'false', true, false].include?(tlsv1)
  @no_tlsv1 = tlsv1
end

#no_tlsv1_1 (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 206

attr_reader :no_tlsv1, :no_tlsv1_1

#no_tlsv1_1=(tlsv1_1) (rw)

disables TLSv1 and TLSv1.1. Overrides #no_tlsv1=

Raises:

  • (ArgumentError)
[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 287

def no_tlsv1_1=(tlsv1_1)
  raise ArgumentError, "Invalid value of no_tlsv1_1=" unless ['true', 'false', true, false].include?(tlsv1_1)
  @no_tlsv1_1 = tlsv1_1
end

#ssl_cipher_filter (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 244

attr_accessor :ssl_cipher_filter

#ssl_cipher_list (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 226

attr_accessor :ssl_cipher_list

#verification_flags (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 245

attr_accessor :verification_flags

#verify_mode (rw)

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 205

attr_accessor :verify_mode

Instance Method Details

#check

See additional method definition at line 233.

[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 272

def check
  raise "Keystore not configured" unless @keystore
end

#check_file(file, desc)

Raises:

  • (ArgumentError)
[ GitHub ]

  
# File 'lib/puma/minissl.rb', line 217

def check_file(file, desc)
  raise ArgumentError, "#{desc} file '#{file}' does not exist" unless File.exist? file
  raise ArgumentError, "#{desc} file '#{file}' is not readable" unless File.readable? file
end