mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Fix ssl and specs for 0.18
This commit is contained in:
parent
74044d62e9
commit
ac4a5afc05
8 changed files with 35 additions and 35 deletions
|
@ -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|
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue