Class: Puma::MiniSSL::Context
- Inherits:
-
Object
- Object
- Puma::MiniSSL::Context
- Defined in:
- lib/puma/minissl.rb
Instance Attribute Summary collapse
-
#ca ⇒ Object
Returns the value of attribute ca.
-
#cert ⇒ Object
Returns the value of attribute cert.
-
#cert_pem ⇒ Object
Returns the value of attribute cert_pem.
-
#cipher_suites ⇒ Object
(also: #ssl_cipher_list)
Returns the value of attribute cipher_suites.
-
#key ⇒ Object
non-jruby Context properties.
-
#key_password_command ⇒ Object
Returns the value of attribute key_password_command.
-
#key_pem ⇒ Object
Returns the value of attribute key_pem.
-
#keystore ⇒ Object
jruby-specific Context properties: java uses a keystore and password pair rather than a cert/key pair.
-
#keystore_pass ⇒ Object
Returns the value of attribute keystore_pass.
-
#keystore_type ⇒ Object
Returns the value of attribute keystore_type.
-
#no_tlsv1 ⇒ Object
Returns the value of attribute no_tlsv1.
-
#no_tlsv1== ⇒ Object
writeonly
disables TLSv1.
-
#no_tlsv1_1 ⇒ Object
Returns the value of attribute no_tlsv1_1.
-
#no_tlsv1_1== ⇒ Object
writeonly
disables TLSv1 and TLSv1.1.
-
#protocols ⇒ Object
Returns the value of attribute protocols.
-
#reuse ⇒ Object
Returns the value of attribute reuse.
-
#reuse_cache_size ⇒ Object
readonly
Returns the value of attribute reuse_cache_size.
-
#reuse_timeout ⇒ Object
readonly
Returns the value of attribute reuse_timeout.
-
#ssl_cipher_filter ⇒ Object
Returns the value of attribute ssl_cipher_filter.
-
#ssl_ciphersuites ⇒ Object
Returns the value of attribute ssl_ciphersuites.
-
#truststore ⇒ Object
Returns the value of attribute truststore.
-
#truststore_pass ⇒ Object
Returns the value of attribute truststore_pass.
-
#truststore_type ⇒ Object
Returns the value of attribute truststore_type.
-
#verification_flags ⇒ Object
Returns the value of attribute verification_flags.
-
#verify_mode ⇒ Object
Returns the value of attribute verify_mode.
Instance Method Summary collapse
- #check ⇒ Object
- #check_file(file, desc) ⇒ Object
-
#initialize ⇒ Context
constructor
A new instance of Context.
-
#key_password ⇒ Object
Executes the command to return the password needed to decrypt the key.
Constructor Details
#initialize ⇒ Context
Returns a new instance of Context.
212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/puma/minissl.rb', line 212 def initialize @no_tlsv1 = false @no_tlsv1_1 = false @key = nil @cert = nil @key_pem = nil @cert_pem = nil @reuse = nil @reuse_cache_size = nil @reuse_timeout = nil end |
Instance Attribute Details
#ca ⇒ Object
Returns the value of attribute ca.
288 289 290 |
# File 'lib/puma/minissl.rb', line 288 def ca @ca end |
#cert ⇒ Object
Returns the value of attribute cert.
287 288 289 |
# File 'lib/puma/minissl.rb', line 287 def cert @cert end |
#cert_pem ⇒ Object
Returns the value of attribute cert_pem.
289 290 291 |
# File 'lib/puma/minissl.rb', line 289 def cert_pem @cert_pem end |
#cipher_suites ⇒ Object Also known as: ssl_cipher_list
Returns the value of attribute cipher_suites.
237 238 239 |
# File 'lib/puma/minissl.rb', line 237 def cipher_suites @cipher_suites end |
#key ⇒ Object
non-jruby Context properties
285 286 287 |
# File 'lib/puma/minissl.rb', line 285 def key @key end |
#key_password_command ⇒ Object
Returns the value of attribute key_password_command.
286 287 288 |
# File 'lib/puma/minissl.rb', line 286 def key_password_command @key_password_command end |
#key_pem ⇒ Object
Returns the value of attribute key_pem.
290 291 292 |
# File 'lib/puma/minissl.rb', line 290 def key_pem @key_pem end |
#keystore ⇒ Object
jruby-specific Context properties: java uses a keystore and password pair rather than a cert/key pair
231 232 233 |
# File 'lib/puma/minissl.rb', line 231 def keystore @keystore end |
#keystore_pass ⇒ Object
Returns the value of attribute keystore_pass.
233 234 235 |
# File 'lib/puma/minissl.rb', line 233 def keystore_pass @keystore_pass end |
#keystore_type ⇒ Object
Returns the value of attribute keystore_type.
232 233 234 |
# File 'lib/puma/minissl.rb', line 232 def keystore_type @keystore_type end |
#no_tlsv1 ⇒ Object
Returns the value of attribute no_tlsv1.
210 211 212 |
# File 'lib/puma/minissl.rb', line 210 def no_tlsv1 @no_tlsv1 end |
#no_tlsv1==(value) ⇒ Object (writeonly)
disables TLSv1
374 375 376 377 |
# File 'lib/puma/minissl.rb', line 374 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 ⇒ Object
Returns the value of attribute no_tlsv1_1.
210 211 212 |
# File 'lib/puma/minissl.rb', line 210 def no_tlsv1_1 @no_tlsv1_1 end |
#no_tlsv1_1==(value) ⇒ Object (writeonly)
disables TLSv1 and TLSv1.1. Overrides ‘#no_tlsv1=`
381 382 383 384 |
# File 'lib/puma/minissl.rb', line 381 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 |
#protocols ⇒ Object
Returns the value of attribute protocols.
238 239 240 |
# File 'lib/puma/minissl.rb', line 238 def protocols @protocols end |
#reuse ⇒ Object
Returns the value of attribute reuse.
295 296 297 |
# File 'lib/puma/minissl.rb', line 295 def reuse @reuse end |
#reuse_cache_size ⇒ Object (readonly)
Returns the value of attribute reuse_cache_size.
295 296 297 |
# File 'lib/puma/minissl.rb', line 295 def reuse_cache_size @reuse_cache_size end |
#reuse_timeout ⇒ Object (readonly)
Returns the value of attribute reuse_timeout.
295 296 297 |
# File 'lib/puma/minissl.rb', line 295 def reuse_timeout @reuse_timeout end |
#ssl_cipher_filter ⇒ Object
Returns the value of attribute ssl_cipher_filter.
291 292 293 |
# File 'lib/puma/minissl.rb', line 291 def ssl_cipher_filter @ssl_cipher_filter end |
#ssl_ciphersuites ⇒ Object
Returns the value of attribute ssl_ciphersuites.
292 293 294 |
# File 'lib/puma/minissl.rb', line 292 def ssl_ciphersuites @ssl_ciphersuites end |
#truststore ⇒ Object
Returns the value of attribute truststore.
234 235 236 |
# File 'lib/puma/minissl.rb', line 234 def truststore @truststore end |
#truststore_pass ⇒ Object
Returns the value of attribute truststore_pass.
236 237 238 |
# File 'lib/puma/minissl.rb', line 236 def truststore_pass @truststore_pass end |
#truststore_type ⇒ Object
Returns the value of attribute truststore_type.
235 236 237 |
# File 'lib/puma/minissl.rb', line 235 def truststore_type @truststore_type end |
#verification_flags ⇒ Object
Returns the value of attribute verification_flags.
293 294 295 |
# File 'lib/puma/minissl.rb', line 293 def verification_flags @verification_flags end |
#verify_mode ⇒ Object
Returns the value of attribute verify_mode.
209 210 211 |
# File 'lib/puma/minissl.rb', line 209 def verify_mode @verify_mode end |
Instance Method Details
#check ⇒ Object
278 279 280 281 |
# File 'lib/puma/minissl.rb', line 278 def check raise "Keystore not configured" unless @keystore # @truststore defaults to @keystore due backwards compatibility end |
#check_file(file, desc) ⇒ Object
224 225 226 227 |
# File 'lib/puma/minissl.rb', line 224 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 |
#key_password ⇒ Object
Executes the command to return the password needed to decrypt the key.
332 333 334 335 336 337 338 339 340 |
# File 'lib/puma/minissl.rb', line 332 def key_password raise "Key password command not configured" if @key_password_command.nil? stdout_str, stderr_str, status = Open3.capture3(@key_password_command) return stdout_str.chomp if status.success? raise "Key password failed with code #{status.exitstatus}: #{stderr_str}" end |