Skip to content

Fixes #39446 - Reject non-PEM content in foreman-certificate-check#676

Open
Satellite-RedHat wants to merge 1 commit into
theforeman:masterfrom
Satellite-RedHat:fixes-39446-reject-non-pem-cert-content
Open

Fixes #39446 - Reject non-PEM content in foreman-certificate-check#676
Satellite-RedHat wants to merge 1 commit into
theforeman:masterfrom
Satellite-RedHat:fixes-39446-reject-non-pem-cert-content

Conversation

@Satellite-RedHat

Copy link
Copy Markdown

Summary:

  • Port check-pem-content from foreman-installer #1062 into foreman-certificate-check
  • Reject certificate and CA bundle files that contain content outside BEGIN/END CERTIFICATE blocks (for example PKCS#12 Bag Attributes or comment lines)

Reference discussion:

theforeman/foreman-installer#1062 (comment)

Why

foreman-certificate-check could previously accept cert/CA files with non-PEM text between blocks. Those files can pass OpenSSL checks but fail later in production. Installer #1062 adds the same guard to katello-certs-check; this change keeps the containerized install path aligned.

Related:

Test cases added

  • test_fails_with_pkcs12_metadata_in_ca_bundle — CA bundle with PKCS#12 metadata (Bag Attributes, subject=, issuer=) between PEM blocks → exit 12
  • test_fails_with_comment_lines_in_certificate_files — server cert and CA bundle with # RETRAITE AC Intermédiaire TLS before PEM blocks → exit 12

Add the same PEM-only validation used by katello-certs-check so custom
certificates and CA bundles fail early during deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant