Skip to content

fix: generated TLS certificate locality is no longer mojibake (#961) - #1003

Closed
ismisepaul wants to merge 1 commit into
devfrom
dev#961-tls-dname
Closed

ismisepaul wants to merge 1 commit into
devfrom
dev#961-tls-dname

Conversation

@ismisepaul

Copy link
Copy Markdown
Member

Fixes #961.

What

properties-maven-plugin (read-project-properties) loads .env with java.util.Properties, which decodes ISO-8859-1. The UTF-8 Á in DNAME (0xC3 0x81) reached keytool as two characters, so the generated keystore's certificate read L=BaileÃthaCliath. The plugin has no encoding setting.

DNAME now writes it as the Á escape, which Properties decodes, with a comment explaining why. Only Maven reads DNAME, so docker compose, which reads .env literally, isn't affected.

Tests

src/test/scripts/tls-keystore-test.sh reads the generated keystore and checks that the certificate owner contains L=BaileÁthaCliath. It runs in the build job straight after the Maven build.

  • On dev: FAIL: TLS certificate owner '… L=BaileÃthaCliath …' does not contain 'L=BaileÁthaCliath'
  • With this change: PASS: TLS certificate owner is CN=OwaspShepherd, OU=SecurityShepherd, O=OWASP, L=BaileÁthaCliath, ST=Laighin, C=IE

Every step of test.yml passed locally (lint, build, PGP check, compose build, Tomcat config check, unit tests, integration tests). actionlint reports nothing on the new step. Its existing notices are on line 126, which this PR doesn't touch.

🤖 Generated with Claude Code

properties-maven-plugin reads .env with java.util.Properties, which
decodes ISO-8859-1, so the UTF-8 "Á" in DNAME reached keytool as two
characters and the certificate read L=BaileÃthaCliath. Write it as the
Á escape, which Properties decodes. DNAME is only read by Maven, so
docker compose is unaffected.

Add a check that the generated certificate's subject matches, and run it
in the build job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ismisepaul ismisepaul added this to the 4.0.0 milestone Oct 25, 2026
Copilot AI balanced review requested due to automatic review settings October 25, 2026 00:44
@ismisepaul ismisepaul moved this from Backlog to Next Release Backlog in Security Shepherd Oct 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused encoding fix addresses Maven’s properties decoding and includes a targeted CI regression check, with no unresolved findings.

No open issues 🎉

What changed in this PR

Fixes #961 by preserving the accented locality name in TLS certificates generated by Maven for the Docker deployment.

Changes:

  • Uses a Unicode escape in .env so Maven decodes Á correctly.
  • Adds a regression script that checks the generated certificate’s locality.
  • Runs the check in CI immediately after the Maven build.
File Description
src/​test/​scripts/​tls-keystore-test.sh Checks the generated certificate contains L=BaileÁthaCliath.
.github/​workflows/​test.yml Runs the TLS certificate check after keystore generation.
.env Escapes Á in DNAME and documents the encoding requirement.

Review effort: Balanced

@ismisepaul

Copy link
Copy Markdown
Member Author

Superseded by #1036, which removes the keytool-maven-plugin step this PR fixed. The TLS certificate is now generated when the container first starts, and its locality is correct (#961 is closed). The branch is left in place.

@ismisepaul ismisepaul closed this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Next Release Backlog

Development

Successfully merging this pull request may close these issues.

Generated TLS certificate's locality is mojibake (L=BaileÃthaCliath): .env is read as ISO-8859-1

2 participants