Skip to content

Fix: Ensure mod_md tls-alpn-01 challenge is usable - #2643

Open
JonasVerhofste wants to merge 1 commit into
puppetlabs:mainfrom
JonasVerhofste:fix/acme-tls
Open

JonasVerhofste wants to merge 1 commit into
puppetlabs:mainfrom
JonasVerhofste:fix/acme-tls

Conversation

@JonasVerhofste

Copy link
Copy Markdown

The challenge is already configurable in apache::mod::md, but it needs the acme-tls/1 protocol to properly work (see "https: Challenges"): https://httpd.apache.org/docs/2.4/mod/mod_md.html

@smortex smortex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@JonasVerhofste

Copy link
Copy Markdown
Author

That looks like a CI bug, not a failed test. 😅

@jst-cyr

jst-cyr commented Aug 19, 2026

Copy link
Copy Markdown
Member

@JonasVerhofste : You are right, the acceptance tests don't run correctly on forks. Initial spec tests look good, I'll run some acceptance tests so we can get platform-specific feedback.

@jst-cyr

jst-cyr commented Aug 19, 2026

Copy link
Copy Markdown
Member

Running CI tests for this PR here: #2644

@jst-cyr

jst-cyr commented Aug 20, 2026

Copy link
Copy Markdown
Member

Acceptance test results here: https://github.com/puppetlabs/puppetlabs-apache/actions/runs/32295187776?pr=2644

All failures in PR acceptance testing match existing failures in the Nightly build against main:

  • SLES-12 fails during provisioning (SSH connection refused before the host comes up) — same on nightly.
  • Debian-13 fails in apache parameters default_confd_files => false doesnt do anything — apache2 fails to start via systemd (mktemp error in the init script) — same on nightly.
  • SLES-15 fails in apache::custom_config define valid config adds the config — apache2ctl not found — same on nightly.

These are pre-existing issues on main, not caused by this change.

Next step will require an engineering review when the team is available, but tests look good!

@jst-cyr

jst-cyr commented Sep 28, 2026

Copy link
Copy Markdown
Member

Rebasing and re-running tests against latest

@jst-cyr

jst-cyr commented Sep 28, 2026

Copy link
Copy Markdown
Member

CI test run created: #2652

@JonasVerhofste

Copy link
Copy Markdown
Author

Rebasing and re-running tests against latest

@jst-cyr That will break my gpg signing, so hit me up if you want me to rebase again. :)

@jst-cyr

jst-cyr commented Sep 28, 2026

Copy link
Copy Markdown
Member

@JonasVerhofste : My apologies for that! I'll ping you the next time before doing that. We do have some new test results though...

Acceptance Test Results: https://github.com/puppetlabs/puppetlabs-apache/actions/runs/36456571257?pr=2652

Mostly green, but some failures on Debian 11 and SLES 12.

  • Debian 11: failures are expected and match with the failures in the nightly run against the main branch. Nothing to fix here.

  • SLES 12: This one looks new. It fails a check that makes sure applying the Puppet manifest twice in a row produces no changes the second time (idempotency). The httpd.conf file changed content on the second run, in the SSL vhost test. Since this PR touches mod_md/TLS-ALPN config, it's worth double-checking that change doesn't cause httpd.conf to get regenerated differently between runs on SLES.

@JonasVerhofste

JonasVerhofste commented Sep 28, 2026 •

Copy link
Copy Markdown
Author

@jst-cyr Going through the codepath I don't see how the SLES12 failure can be caused by this PR for httpd.conf specifically: in the test apache::protocols is not changed from its default [] and nothing turns on acme-tls/1 elsewhere afaict.

Would it be an option to somehow turn on diff output for the litmus tests (show_diff in the puppet.conf), so that we can actually see what changes? The current output tells us that something changed, but not what.

I mostly think this is a flaky test and nothing to do with the change, but with the diff output we could confirm for sure.

@jst-cyr

jst-cyr commented Sep 29, 2026

Copy link
Copy Markdown
Member

@JonasVerhofste : It does seem like SLES 12 is quite flaky. Been trying to re-run the tests and it keeps failing provisioning. I think you are right that there is something flaky with the SLES 12 infrastructure. Leave this one with me and I will try to rerun that particular test once provisioning is working again and see if we get the same result.

@jst-cyr

jst-cyr commented Sep 30, 2026

Copy link
Copy Markdown
Member

@JonasVerhofste : As you suspected, not a logical problem, but flaky infrastructure. It took a lot of runs (12, specifically) but I eventually got SLES 12 to green. There must be something in the way the infra is provisioned that can cause acceptance tests to fail, but it does look like we are good to go now!

@JonasVerhofste

Copy link
Copy Markdown
Author

@jst-cyr I already rebased and force pushed, so from my end: merge at will! :)

@jst-cyr

jst-cyr commented Oct 1, 2026

Copy link
Copy Markdown
Member

@JonasVerhofste : It still needs an engineering review, but I've put this on their backlog list so the team can review when they have a moment!

@span786 span786 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.

Thanks @JonasVerhofste. Allowing acme-tls/1 in protocols is the right fix for tls-alpn-01, which apache::mod::md already accepts in md_ca_challenges. The init.pp side looks good.

The vhost.pp side has a placement issue (inline comment). Could you also add rspec-puppet cases for both classes? For example: protocols => ['acme-tls/1'] compiles and contains Class['apache::mod::md'], with and without h2. Those would have caught it.

Comment thread manifests/vhost.pp
'h2_upgrade' => $h2_upgrade,
'h2_window_size' => $h2_window_size,
}
if 'acme-tls/1' in $protocols {

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.

This include is nested inside the if ('h2' in $protocols or 'h2c' in $protocols or $h2_copy_files != undef or ...) and $ensure == 'present' block. With only acme-tls/1 (e.g. protocols => ['acme-tls/1', 'http/1.1'], the typical non-HTTP/2 setup) that block is skipped, so apache::mod::md is never included. That's exactly the case this PR is meant to fix. It only works today if the vhost also enables h2/h2c or sets an h2_* parameter.

Could it move out of the HTTP/2 block and merge with the existing mdomain check just below? Something like:

  if ($mdomain or 'acme-tls/1' in $protocols) and $ensure == 'present' {
    include apache::mod::md
  }

That also keeps the $ensure == 'present' guard.

@span786 span786 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.

I'm marking my earlier review as changes requested so this doesn't merge as-is.

In manifests/vhost.pp, include apache::mod::md is nested inside the HTTP/2 block. A vhost with only acme-tls/1 (e.g. protocols => ['acme-tls/1', 'http/1.1']) therefore never loads mod_md, which is the case this PR is meant to fix. Please move it out of that block, for example:

  if ($mdomain or 'acme-tls/1' in $protocols) and $ensure == 'present' {
    include apache::mod::md
  }

Please also add rspec-puppet coverage for acme-tls/1 with and without h2, in both apache and apache::vhost. I'll approve once those are in.

@span786 span786 self-assigned this Oct 27, 2026
The challenge is already configurable in apache::mod::md, but it needs
the `acme-tls/1` protocol to properly work (see "https: Challenges"):
https://httpd.apache.org/docs/2.4/mod/mod_md.html

Signed-off-by: Jonas Verhofsté <jonas@verhofste.tech>
@span786

span786 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

@JonasVerhofste, thanks for the push. I don't think it picked up the requested changes, though. The head is back at 91555ab0, which is the original commit from before the rebase, so:

  • include apache::mod::md in manifests/vhost.pp is still inside the HTTP/2 block. A vhost with protocols => ['acme-tls/1', 'http/1.1'] still never loads mod_md (details).
  • There are no rspec-puppet cases yet for acme-tls/1 with and without h2, in apache and apache::vhost.
  • The branch is 7 commits behind main again, so please rebase as well.

Happy to approve once those are in.

@JonasVerhofste

Copy link
Copy Markdown
Author

@span786 If you look at the comittor, you'll notice it was you who pushed, not me. :P

Haven't had the time to look at it further, it'll probably be for this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants