Skip to content

Commit

Permalink
Merge pull request #580 from yast/import_cert_sp3
Browse files Browse the repository at this point in the history
Import the SSL certificate also in the self-update step
  • Loading branch information
lslezak committed Jul 11, 2022
2 parents dd3e1c8 + e97b21d commit e747d7a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package/yast2-registration.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jul 7 08:06:01 UTC 2022 - Ladislav Slezák <lslezak@suse.cz>

- Import the SSL certificate from the <reg_server_cert> AutoYaST
data also in the self-update step (bsc#1199091, bsc#1198642)
- 4.3.26

-------------------------------------------------------------------
Mon Nov 1 11:28:32 UTC 2021 - Josef Reidinger <jreidinger@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-registration.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-registration
Version: 4.3.25
Version: 4.3.26
Release: 0
Summary: YaST2 - Registration Module
License: GPL-2.0-only
Expand Down
12 changes: 12 additions & 0 deletions src/lib/registration/connect_helpers.rb
Expand Up @@ -228,6 +228,18 @@ def self.handle_ssl_error(error, certificate_imported)
Yast::Report.Error(_("Received SSL Certificate does not match " \
"the expected certificate."))
end
elsif Yast::Mode.autoinst && Storage::Config.instance.reg_server_cert &&
!Storage::Config.instance.reg_server_cert.empty?

# try just once to avoid endless loop
if !certificate_imported
cert_url = Storage::Config.instance.reg_server_cert
log.info "Importing certificate from #{cert_url}..."
cert = SslCertificate.download(cert_url)
return true if cert.import
end

report_ssl_error(error.message, cert, error_code)
else
report_ssl_error(error.message, cert, error_code)
end
Expand Down

0 comments on commit e747d7a

Please sign in to comment.