Class: Wsv::TlsContext
- Inherits:
-
Object
- Object
- Wsv::TlsContext
- Defined in:
- lib/wsv/tls_context.rb,
lib/wsv/tls_context/resolver.rb,
lib/wsv/tls_context/self_signed_cert.rb
Defined Under Namespace
Classes: Resolver, SelfSignedCert
Instance Attribute Summary collapse
-
#cert ⇒ Object
readonly
Returns the value of attribute cert.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #ephemeral? ⇒ Boolean
-
#initialize(cert:, key:, ephemeral: false) ⇒ TlsContext
constructor
A new instance of TlsContext.
- #to_ssl_context ⇒ Object
Constructor Details
#initialize(cert:, key:, ephemeral: false) ⇒ TlsContext
Returns a new instance of TlsContext.
11 12 13 14 15 |
# File 'lib/wsv/tls_context.rb', line 11 def initialize(cert:, key:, ephemeral: false) @cert = cert @key = key @ephemeral = ephemeral end |
Instance Attribute Details
#cert ⇒ Object (readonly)
Returns the value of attribute cert.
9 10 11 |
# File 'lib/wsv/tls_context.rb', line 9 def cert @cert end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/wsv/tls_context.rb', line 9 def key @key end |
Instance Method Details
#ephemeral? ⇒ Boolean
17 18 19 |
# File 'lib/wsv/tls_context.rb', line 17 def ephemeral? @ephemeral end |
#to_ssl_context ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/wsv/tls_context.rb', line 21 def to_ssl_context ctx = OpenSSL::SSL::SSLContext.new ctx.cert = @cert ctx.key = @key ctx.min_version = OpenSSL::SSL::TLS1_2_VERSION ctx end |