kemal/src/kemal/middleware/ssl.cr

18 lines
310 B
Crystal

module Kemal::Middleware
class SSL
getter context
def initialize
@context = OpenSSL::SSL::Context::Server.new
end
def set_key_file(key_file)
@context.private_key = key_file
end
def set_cert_file(cert_file)
@context.certificate_chain = cert_file
end
end
end