Skip to content

Commit

Permalink
serve: add support for ECC certificates (#7768)
Browse files Browse the repository at this point in the history
Merge pull request 7768
  • Loading branch information
vszakats authored and jekyllbot committed Aug 22, 2019
1 parent c55eaf7 commit 650dcc6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/jekyll/commands/serve.rb
Expand Up @@ -307,7 +307,15 @@ def enable_ssl(opts)
require "webrick/https"

opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(read_file(src, cert))
opts[:SSLPrivateKey] = OpenSSL::PKey::RSA.new(read_file(src, key))
begin
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
end

Expand Down

0 comments on commit 650dcc6

Please sign in to comment.