-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation about starting the wiremock container with SSL #164
Comments
Looking at the code it doesn't look like HTTPS is at all supported. Writing the code to add it looks relatively simple, but the sheer amount of test code looks a bit scary to get involved with. It seems currently there is no way to expose a mapped port for HTTPS. |
The reason why using withExposedPorts does not work is simply because as part of the startup for a container, it calls configure, see here: https://github.com/testcontainers/testcontainers-java/blob/main/core/src/main/java/org/testcontainers/containers/GenericContainer.java#L331 Which calls this method: https://github.com/wiremock/wiremock-testcontainers-java/blob/main/src/main/java/org/wiremock/integrations/testcontainers/WireMockContainer.java#L372 Which then sets the withExposedPorts to 8080 and will wipe all ports that have been set by the user. A potential hotfix - that shouldn't require much - if at all testing would be to use addExposedPorts instead of withExposedPorts which will not override any user selections. |
PR created - hopefully up to standards :). Definitely a tactical fix - I think in the future it would make sense to have actual methods for configuring the HTTPS stuff but I needed to unblock myself and fix this issue. I'll come back to this in the future to see if I can create a full solution for HTTPS. With this change you would need to still configure HTTPS using:
Aswell as the other CLI args you require from here: https://wiremock.org/docs/standalone/java-jar/ - Like keystore/truststore etc. |
Good fix, however it would be good to provide the flexibility to override the containers default entry command. I had initially tried overriding it using |
There is no documentation on how to start the container and wiremock to expose a https endpoint.
I have toyed with multiple configurations, including enabling debug mode but the server still exposes default 8080 port in http mode.
The text was updated successfully, but these errors were encountered: