serve: add support for ECC certificates (#7768)

Merge pull request 7768
This commit is contained in:
Viktor Szakats 2019-08-22 18:03:23 +00:00 committed by jekyllbot
parent c55eaf7724
commit 650dcc637a
1 changed files with 9 additions and 1 deletions

View File

@ -307,7 +307,15 @@ module Jekyll
require "webrick/https" require "webrick/https"
opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(read_file(src, cert)) opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(read_file(src, cert))
begin
opts[:SSLPrivateKey] = OpenSSL::PKey::RSA.new(read_file(src, key)) opts[:SSLPrivateKey] = OpenSSL::PKey::RSA.new(read_file(src, key))
rescue StandardError
if defined?(OpenSSL::PKey::EC)
opts[:SSLPrivateKey] = OpenSSL::PKey::EC.new(read_file(src, key))
else
raise
end
end
opts[:SSLEnable] = true opts[:SSLEnable] = true
end end