Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1519862 - rhui-manager cert upload (CLI) doesn't handle an expired certificate well [NEEDINFO]
rhui-manager cert upload (CLI) doesn't handle an expired certificate well
Status: CLOSED ERRATA
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools (Show other bugs)
3.0.0
Unspecified Unspecified
unspecified Severity unspecified
: 3.0.4
: 3.0.x
Assigned To: Martin Minar
Vratislav Hutsky
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-12-01 10:01 EST by Radek Bíba
Modified: 2018-07-10 12:00 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-07-10 12:00:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
mminar: needinfo? (lwilliam)


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2153 None None None 2018-07-10 12:00 EDT

  None (edit)
Description Radek Bíba 2017-12-01 10:01:23 EST
Description of problem:
When I try uploading an expired certificate in the interactive mode, I get this proper error message:

The provided certificate is expired or invalid.  Please upload a valid one

I'd expect a similar response in the CLI, but here's what actually happens:

[root@rhua ~]# rhui-manager cert upload --cert shortlivedcert.pem 

An unexpected error has occurred during the last operation.


[root@rhua ~]#

When I look at the end of /root/.rhui/rhui.log, I find this:

2017-12-01 14:54:54,516 - Connecting to RHUA [rhua.example.com]...
2017-12-01 14:54:54,520 - Successfully connected to [rhua.example.com]
2017-12-01 14:54:54,522 - This certificate is invalid or expired.
None
2017-12-01 14:54:54,522 - Unexpected error caught at the shell level
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rhui/tools/cli.py", line 66, in run
    Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/rhui/common/cli.py", line 272, in run
    command_or_section.execute(remaining_args)
  File "/usr/lib/python2.7/site-packages/rhui/common/cli.py", line 113, in execute
    self.method(**arg_dict)
  File "/usr/lib/python2.7/site-packages/rhui/tools/commands/cert.py", line 57, in upload
    self._upload_cert(valid_cert_filename)
  File "/usr/lib/python2.7/site-packages/rhui/tools/commands/cert.py", line 101, in _upload_cert
    self.cert_manager.add_certificate(valid_cert_filename)
  File "/usr/lib/python2.7/site-packages/rhui/tools/cert_manager.py", line 273, in add_certificate
    raise InvalidOrExpiredCertificate()
InvalidOrExpiredCertificate
2017-12-01 14:54:54,523 - 
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rhui/tools/cli.py", line 66, in run
    Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/rhui/common/cli.py", line 272, in run
    command_or_section.execute(remaining_args)
  File "/usr/lib/python2.7/site-packages/rhui/common/cli.py", line 113, in execute
    self.method(**arg_dict)
  File "/usr/lib/python2.7/site-packages/rhui/tools/commands/cert.py", line 57, in upload
    self._upload_cert(valid_cert_filename)
  File "/usr/lib/python2.7/site-packages/rhui/tools/commands/cert.py", line 101, in _upload_cert
    self.cert_manager.add_certificate(valid_cert_filename)
  File "/usr/lib/python2.7/site-packages/rhui/tools/cert_manager.py", line 273, in add_certificate
    raise InvalidOrExpiredCertificate()
InvalidOrExpiredCertificate

But I only look there because I already know where to look. Please allow the CLI to print an error message that says it all, or at lease add the location of this log file to the current error message (such as Please check ~/.rhui/rhui.log for more details.)

Version-Release number of selected component (if applicable):
rh-rhui-tools-3.0.1-3.el7ui.noarch
Comment 7 errata-xmlrpc 2018-07-10 12:00:36 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2153

Note You need to log in before you can comment on or make changes to this bug.