diff --git a/app/controllers/repp/v1/certificates/p12_controller.rb b/app/controllers/repp/v1/certificates/p12_controller.rb index 3b3e9f182..13f5283fd 100644 --- a/app/controllers/repp/v1/certificates/p12_controller.rb +++ b/app/controllers/repp/v1/certificates/p12_controller.rb @@ -13,7 +13,7 @@ module Repp api_user_id = p12_params[:api_user_id] render_error(I18n.t('errors.messages.not_found'), :not_found) and return if api_user_id.blank? - certificate = ::Certificates::CertificateGenerator.new(api_user_id: api_user_id).execute + certificate = ::Certificates::CertificateGenerator.new(api_user_id: api_user_id, interface: 'registrar').execute render_success(data: { certificate: certificate }) end diff --git a/app/models/certificate.rb b/app/models/certificate.rb index ec30f6aec..a885f462a 100644 --- a/app/models/certificate.rb +++ b/app/models/certificate.rb @@ -131,7 +131,7 @@ class Certificate < ApplicationRecord cn = pc.scan(%r{\/CN=(.+)}).flatten.first self.common_name = cn.split('/').first self.md5 = OpenSSL::Digest::MD5.new(origin.to_der).to_s if crt - self.interface = crt ? API : REGISTRAR + self.interface = crt ? API : REGISTRAR if interface.blank? end def create_tempfile(filename, content = '')