mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Update to use HTTP::Server#bind_ssl (#477)
This commit is contained in:
parent
64fbe406d5
commit
b39c974a90
1 changed files with 9 additions and 5 deletions
14
src/kemal.cr
14
src/kemal.cr
|
@ -39,10 +39,6 @@ module Kemal
|
|||
|
||||
server = config.server ||= HTTP::Server.new(config.handlers)
|
||||
|
||||
{% if !flag?(:without_openssl) %}
|
||||
config.server.not_nil!.tls = config.ssl
|
||||
{% end %}
|
||||
|
||||
config.running = true
|
||||
|
||||
yield config
|
||||
|
@ -51,7 +47,15 @@ module Kemal
|
|||
return unless config.running
|
||||
|
||||
unless server.each_address { |_| break true }
|
||||
server.bind_tcp(config.host_binding, config.port)
|
||||
{% if flag?(:without_openssl) %}
|
||||
server.bind_tcp(config.host_binding, config.port)
|
||||
{% else %}
|
||||
if ssl = config.ssl
|
||||
server.bind_ssl(config.host_binding, config.port, ssl)
|
||||
else
|
||||
server.bind_tcp(config.host_binding, config.port)
|
||||
end
|
||||
{% end %}
|
||||
end
|
||||
|
||||
display_startup_message(config, server)
|
||||
|
|
Loading…
Reference in a new issue