class Falcon::Host
def initialize
def initialize @app = nil @endpoint = nil @ssl_certificate = nil @ssl_key = nil end
def ssl_certificate_path= path
def ssl_certificate_path= path @ssl_certificate = OpenSSL::X509::Certificate.new(File.read(path)) end
def ssl_context
def ssl_context if @ssl_key OpenSSL::SSL::SSLContext.new.tap do |context| context.cert = @ssl_certificate context.key = @ssl_key context.set_params end end end
def ssl_key_path= path
def ssl_key_path= path @ssl_key = OpenSSL::PKey::RSA.new(File.read(path)) end
def start
def start if app = self.app Async::Container::Forked.new do server = Falcon::Server.new(app, self.server_endpoint) server.run end end end