Class: Uninterruptible::TLSServerFactory
- Inherits:
-
Object
- Object
- Uninterruptible::TLSServerFactory
- Defined in:
- lib/uninterruptible/tls_server_factory.rb
Overview
Wraps a bound TCP server with an OpenSSL::SSL::SSLServer according to the Uninterruptible::Configuration for this server.
Defined Under Namespace
Classes: CertificateChain
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
-
#initialize(configuration) ⇒ TLSServerFactory
constructor
A new instance of TLSServerFactory.
-
#wrap_with_tls(tcp_server) ⇒ OpenSSL::SSL::SSLServer
Accepts a TCP server, gives it a nice friendly SSLServer wrapper and returns the SSLServer.
Constructor Details
#initialize(configuration) ⇒ TLSServerFactory
Returns a new instance of TLSServerFactory.
24 25 26 27 |
# File 'lib/uninterruptible/tls_server_factory.rb', line 24 def initialize(configuration) @configuration = configuration check_configuration! end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
5 6 7 |
# File 'lib/uninterruptible/tls_server_factory.rb', line 5 def configuration @configuration end |
Instance Method Details
#wrap_with_tls(tcp_server) ⇒ OpenSSL::SSL::SSLServer
Accepts a TCP server, gives it a nice friendly SSLServer wrapper and returns the SSLServer
34 35 36 37 38 |
# File 'lib/uninterruptible/tls_server_factory.rb', line 34 def wrap_with_tls(tcp_server) server = OpenSSL::SSL::SSLServer.new(tcp_server, ssl_context) server.start_immediately = false server end |