Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PKI Server CA Certificate Request from cert not work #4581

Open
fmarco76 opened this issue Oct 5, 2023 · 0 comments
Open

PKI Server CA Certificate Request from cert not work #4581

fmarco76 opened this issue Oct 5, 2023 · 0 comments

Comments

@fmarco76
Copy link
Member

fmarco76 commented Oct 5, 2023

Trying to get a certificate request from a certificate does not work. The error is:

[root@pki /]# pki-server ca-cert-request-find --cert-file ca3_s.pem 
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pki/server/pkiserver.py", line 41, in <module>
    cli.execute(sys.argv)
  File "/usr/lib/python3.11/site-packages/pki/server/cli/__init__.py", line 145, in execute
    super().execute(args)
  File "/usr/lib/python3.11/site-packages/pki/cli/__init__.py", line 217, in execute
    module.execute(module_args)
  File "/usr/lib/python3.11/site-packages/pki/cli/__init__.py", line 217, in execute
    module.execute(module_args)
  File "/usr/lib/python3.11/site-packages/pki/cli/__init__.py", line 217, in execute
    module.execute(module_args)
  [Previous line repeated 1 more time]
  File "/usr/lib/python3.11/site-packages/pki/server/cli/ca.py", line 642, in execute
    results = subsystem.find_cert_requests(cert=cert)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pki/server/subsystem.py", line 2245, in find_cert_requests
    escaped_value = ldap.filter.escape_filter_chars(pki.nssdb.convert_cert(cert, 'pem' ,'base64'))
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pki/nssdb.py", line 131, in convert_cert
    return convert_data(cert_data, input_format, output_format,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pki/nssdb.py", line 105, in convert_data
    line = line.rstrip('\r\n')
           ^^^^^^^^^^^^^^^^^^^
TypeError: a bytes-like object is required, not 'str'

A simple conversion of the certificate from binary to string in base/server/python/pki/server/cli/ca.py:642 solve the issue but the request is not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant