mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Make ssl api more idiomatic
This commit is contained in:
parent
f3f9864ae5
commit
878c70e0d9
2 changed files with 4 additions and 4 deletions
|
@ -50,8 +50,8 @@ module Kemal
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
ssl = Kemal::SSL.new
|
ssl = Kemal::SSL.new
|
||||||
ssl.set_key_file @key_file.not_nil!
|
ssl.key_file = @key_file.not_nil!
|
||||||
ssl.set_cert_file @cert_file.not_nil!
|
ssl.cert_file = @cert_file.not_nil!
|
||||||
Kemal.config.ssl = ssl.context
|
Kemal.config.ssl = ssl.context
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
|
@ -6,11 +6,11 @@ module Kemal
|
||||||
@context = OpenSSL::SSL::Context::Server.new
|
@context = OpenSSL::SSL::Context::Server.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_key_file(key_file)
|
def key_file=(key_file)
|
||||||
@context.private_key = key_file
|
@context.private_key = key_file
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_cert_file(cert_file)
|
def cert_file=(cert_file)
|
||||||
@context.certificate_chain = cert_file
|
@context.certificate_chain = cert_file
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue