RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1973023 - CA_less ipa-server-install fails if CA cert subject contains non ascii chars
Summary: CA_less ipa-server-install fails if CA cert subject contains non ascii chars
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ipa
Version: 8.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Florence Blanc-Renaud
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-17 06:21 UTC by Florence Blanc-Renaud
Modified: 2021-11-09 23:59 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 18:29:22 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-7280 0 None None None 2021-11-09 18:32:25 UTC
Red Hat Product Errata RHBA-2021:4230 0 None None None 2021-11-09 18:29:43 UTC

Description Florence Blanc-Renaud 2021-06-17 06:21:43 UTC
Cloned from upstream: https://pagure.io/freeipa/issue/8880

### Issue
In a CA less setup, if the CA certificate subject contains non-ASCII characters, ipa-server-install fails with a UnicodeDecodeError.

#### Steps to Reproduce
1. Create a CA with subject CN=CA,O=España
2. With this CA, create http and dirsrv certificates CN=server.ipa.test,O=España
3. install the server with ipa-server-install --http-cert-file .. --dirsrv-cert-file .. --ca-cert-file

#### Actual behavior
ipa-server-install fails when configuring SSL for HTTPd:
```
Configuring the web interface (httpd)
  [1/20]: stopping httpd
  [2/20]: backing up ssl.conf
  [3/20]: disabling nss.conf
  [4/20]: configuring mod_ssl certificate paths
  [5/20]: setting mod_ssl protocol list
  [6/20]: configuring mod_ssl log directory
  [7/20]: disabling mod_ssl OCSP
  [8/20]: adding URL rewriting rules
  [9/20]: configuring httpd
  [10/20]: setting up httpd keytab
  [11/20]: configuring Gssproxy
  [12/20]: setting up ssl
  [error] UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 67: invalid continuation byte
'utf-8' codec can't decode byte 0xd1 in position 67: invalid continuation byte
The ipa-server-install command failed. See /var/log/ipaserver-install.log for more information
```

#### Expected behavior
The installation should succeed

#### Version/Release/Distribution
freeipa-server-4.9.3-4.fc34.x86_64
freeipa-client-4.9.3-4.fc34.x86_64
389-ds-base-2.0.5-1.fc34.x86_64
pki-ca-10.10.5-6.fc34.noarch
krb5-server-1.19.1-3.fc34.x86_64

#### Additional info:
Traceback:
```
2021-06-09T16:43:35Z DEBUG Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/ipaserver/install/service.py", line 635, in start_creation
    run_step(full_msg, method)
  File "/usr/lib/python3.9/site-packages/ipaserver/install/service.py", line 621, in run_step
    method()
  File "/usr/lib/python3.9/site-packages/ipaserver/install/httpinstance.py", line 331, in __setup_ssl
    p12_certs, p12_priv_keys = certs.pkcs12_to_certkeys(
  File "/usr/lib/python3.9/site-packages/ipaserver/install/certs.py", line 106, in pkcs12_to_certkeys
    pems = ipautil.run(args, capture_output=True).raw_output
  File "/usr/lib/python3.9/site-packages/ipapython/ipautil.py", line 585, in run
    output = stdout.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 67: invalid continuation byte
```

Comment 1 Florence Blanc-Renaud 2021-06-17 06:23:49 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/8880

Comment 2 Florence Blanc-Renaud 2021-06-17 06:24:51 UTC
Fixed upstream:
master:

    fb74866 CA-less install: non-ASCII chars in CA cert subject
    0faddc9 ipatests: use non-ascii chars in CA-less install


ipa-4-9:

    7b278b6 CA-less install: non-ASCII chars in CA cert subject
    4b040e1 ipatests: use non-ascii chars in CA-less install

Comment 9 Ganna Kaihorodova 2021-08-04 12:24:12 UTC
Bugzilla tested and verified with existing test automation and latest rhel8.5 compose

ipa-server-4.9.6-4.module+el8.5.0+11912+1b4496cf.x86_64.rpm 

transport.py               558 DEBUG    Synchronizing time
transport.py               558 DEBUG    No SRV records of NTP servers found and no NTP server or pool address was provided.
transport.py               558 DEBUG    Attempting to sync time with chronyc.
transport.py               558 DEBUG    Process chronyc waitsync failed to sync time!
transport.py               558 DEBUG    Unable to sync time with chrony server, assuming the time is in sync. Please check that 123 UDP port is opened, and any time server is on network.
transport.py               558 DEBUG    Successfully retrieved CA cert
transport.py               558 DEBUG        Subject:     CN=CA,O=Example Organization España
transport.py               558 DEBUG        Issuer:      CN=CA,O=Example Organization España
transport.py               558 DEBUG        Valid From:  2021-08-02 16:42:54
transport.py               558 DEBUG        Valid Until: 2031-07-31 16:42:54

Full verification log in attached file

Comment 11 errata-xmlrpc 2021-11-09 18:29:22 UTC
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 (ipa bug fix and enhancement update), 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-2021:4230


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