summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorVladimir Shushlin <vshushlin@gitlab.com>2019-09-07 00:29:03 +0000
committerMichael Kozono <mkozono@gmail.com>2019-09-07 00:29:03 +0000
commit8c3d0703ed71e9ac166b221146176a3ea7e23989 (patch)
treed40d8446bf384a0cffb95e818bbeac4f55221a8a /app/models
parent7920ff1147051324e63c6b28cd93ca616d5b3165 (diff)
downloadgitlab-ce-8c3d0703ed71e9ac166b221146176a3ea7e23989.tar.gz
Allow to load ECDSA certificates for pages domains
Just replace RSA.new with PKey.read
Diffstat (limited to 'app/models')
-rw-r--r--app/models/pages_domain.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb
index 12ce717efd7..a2a471074a9 100644
--- a/app/models/pages_domain.rb
+++ b/app/models/pages_domain.rb
@@ -17,7 +17,7 @@ class PagesDomain < ApplicationRecord
validates :certificate, certificate: true, if: ->(domain) { domain.certificate.present? }
validates :key, presence: { message: 'must be present if HTTPS-only is enabled' },
if: :certificate_should_be_present?
- validates :key, certificate_key: true, if: ->(domain) { domain.key.present? }
+ validates :key, certificate_key: true, named_ecdsa_key: true, if: ->(domain) { domain.key.present? }
validates :verification_code, presence: true, allow_blank: false
validate :validate_pages_domain
@@ -247,7 +247,7 @@ class PagesDomain < ApplicationRecord
def pkey
return unless key
- @pkey ||= OpenSSL::PKey::RSA.new(key)
+ @pkey ||= OpenSSL::PKey.read(key)
rescue OpenSSL::PKey::PKeyError, OpenSSL::Cipher::CipherError
nil
end