Skip to content

AMP-345 Enable WireMock HTTPS and add SSL callback test#220

Merged
vineetkapoor-hmcts merged 1 commit intomainfrom
chore/wiremock-ssl
Apr 14, 2026
Merged

AMP-345 Enable WireMock HTTPS and add SSL callback test#220
vineetkapoor-hmcts merged 1 commit intomainfrom
chore/wiremock-ssl

Conversation

@coling01
Copy link
Copy Markdown
Collaborator

JIRA

AMP-345

What changed

  • Added --https-port=8443 to WireMock's docker-compose command and exposed port 8443:8443
  • Added mock_https_callback_client_should_respond_ok test hitting https://localhost:8443
  • Added trustLocalhostRestClient() helper that installs a trust-all SSLContext via SimpleClientHttpRequestFactory with a HostnameVerifier restricted to localhost only

Why it's needed

The callback endpoint must support HTTPS. WireMock needed SSL enabling in the test environment and the test client needed configuring to accept WireMock's self-signed certificate — but only for localhost, making it impossible to accidentally use against real remote endpoints.

🤖 Generated with Claude Code

- Expose port 8443 and pass --https-port=8443 to WireMock in docker-compose
- Add mock_https_callback_client_should_respond_ok test using trustLocalhostRestClient
- trustLocalhostRestClient uses SimpleClientHttpRequestFactory with a trust-all SSLContext
  and a localhost-only HostnameVerifier, making test-only intent explicit and safe

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vineetkapoor-hmcts vineetkapoor-hmcts merged commit b6b8e16 into main Apr 14, 2026
15 checks passed
@vineetkapoor-hmcts vineetkapoor-hmcts deleted the chore/wiremock-ssl branch April 14, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants