Fix ssl and specs for 0.18

This commit is contained in:
Omar Roth 2016-06-14 16:18:00 -05:00
parent 74044d62e9
commit ac4a5afc05
8 changed files with 35 additions and 35 deletions

View file

@ -10,7 +10,7 @@ module Kemal
config.add_handler Kemal::RouteHandler::INSTANCE
config.server = HTTP::Server.new(config.host_binding.not_nil!, config.port, config.handlers)
config.server.not_nil!.ssl = config.ssl
config.server.not_nil!.tls = config.ssl
unless Kemal.config.error_handlers.has_key?(404)
error 404 do |env|

View file

@ -45,8 +45,8 @@ module Kemal
puts "SSL Key Not Found"; exit unless @key_file
puts "SSL Certificate Not Found"; exit unless @cert_file
ssl = Kemal::Middleware::SSL.new
ssl.set_key_file @key_file.not_nil!.to_slice
ssl.set_cert_file @cert_file.not_nil!.to_slice
ssl.set_key_file @key_file.not_nil!
ssl.set_cert_file @cert_file.not_nil!
Kemal.config.ssl = ssl.context
end
end

View file

@ -3,7 +3,7 @@ module Kemal
INSTANCE = Config.new
HANDLERS = [] of HTTP::Handler
ERROR_HANDLERS = {} of Int32 => HTTP::Server::Context -> String
@ssl : OpenSSL::SSL::Context?
@ssl : OpenSSL::SSL::Context::Server?
@server : HTTP::Server?
property host_binding, ssl, port, env, public_folder, logging,

View file

@ -3,7 +3,7 @@ module Kemal::Middleware
getter context
def initialize
@context = OpenSSL::SSL::Context.new
@context = OpenSSL::SSL::Context::Server.new
end
def set_key_file(key_file)