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 1973024 - 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 CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: ipa
Version: 9.0
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:27 UTC by Florence Blanc-Renaud
Modified: 2021-12-07 21:32 UTC (History)
4 users (show)

Fixed In Version: ipa-4.9.6-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-07 21:30:47 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-7432 0 None None None 2021-12-02 14:30:04 UTC

Description Florence Blanc-Renaud 2021-06-17 06:27:06 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:28:15 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/8880

Comment 2 Florence Blanc-Renaud 2021-06-17 06:28:34 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 6 anuja 2021-07-16 05:38:24 UTC
Verified using:
2021-07-15T13:40:44+0000 ok: [master.testrelm.test] => (item=ipa-server) => 
2021-07-15T13:40:44+0000   msg:
2021-07-15T13:40:44+0000   - arch: x86_64
2021-07-15T13:40:44+0000     epoch: null
2021-07-15T13:40:44+0000     name: ipa-server
2021-07-15T13:40:44+0000     release: 2.el9
2021-07-15T13:40:44+0000     source: rpm
2021-07-15T13:40:44+0000     version: 4.9.6

Using test:
ipatests/test_integration/test_caless.py::TestServerInstall::()::test_valid_certs

2021-07-15T14:46:20+0000 ============================= test session starts ==============================
2021-07-15T14:46:20+0000 platform linux -- Python 3.9.6, pytest-3.10.1, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
2021-07-15T14:46:20+0000 cachedir: .pytest_cache
2021-07-15T14:46:20+0000 metadata: {'Python': '3.9.6', 'Platform': 'Linux-5.12.13-200.fc33.x86_64-x86_64-with-glibc2.32', 'Packages': {'pytest': '3.10.1', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.11.0', 'html': '1.22.1', 'multihost': '3.0', 'sourceorder': '0.5'}}
2021-07-15T14:46:20+0000 rootdir: /tmp/wp/freeipa, inifile: tox.ini
2021-07-15T14:46:20+0000 plugins: metadata-1.11.0, html-1.22.1, multihost-3.0, sourceorder-0.5
2021-07-15T14:46:20+0000 collecting ... collected 1 item
2021-07-15T14:46:21+0000 
2021-07-15T14:51:17+0000 ipatests/test_integration/test_caless.py::TestServerInstall::test_valid_certs PASSED [100%]
2021-07-15T14:51:17+0000 
2021-07-15T14:51:17+0000 ------------------ generated xml file: /tmp/wp/twd/junit.xml -------------------
2021-07-15T14:51:17+0000 ------------- generated html file: file:///tmp/wp/twd/report.html --------------
2021-07-15T14:51:17+0000 ========================== 1 passed in 296.78 seconds ==========================


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