Skip to content

Commit 7411a62

Browse files
committed
Allow specifying https-keystore without https-port
WireMock can now proxy HTTPS over its HTTP port. This means it's valid to provide a keystore to configure how that HTTPS is encrypted despite not listening for HTTPS directly.
1 parent 245df54 commit 7411a62

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

Diff for: src/main/java/com/github/tomakehurst/wiremock/standalone/CommandLineOptions.java

-3
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ private void validate() {
171171
if (!optionSet.has(HTTPS_PORT) && optionSet.has(DISABLE_HTTP)) {
172172
throw new IllegalArgumentException("HTTPS must be enabled if HTTP is not.");
173173
}
174-
if (optionSet.has(HTTPS_KEYSTORE) && !optionSet.has(HTTPS_PORT)) {
175-
throw new IllegalArgumentException("HTTPS port number must be specified if specifying the keystore path");
176-
}
177174

178175
if (optionSet.has(RECORD_MAPPINGS) && optionSet.has(DISABLE_REQUEST_JOURNAL)) {
179176
throw new IllegalArgumentException("Request journal must be enabled to record stubs");

Diff for: src/test/java/com/github/tomakehurst/wiremock/standalone/CommandLineOptionsTest.java

-5
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ public void setsKeyStorePathAndPassword() {
127127
assertThat(options.httpsSettings().keyStorePassword(), is("someotherpwd"));
128128
}
129129

130-
@Test(expected=IllegalArgumentException.class)
131-
public void throwsExceptionIfKeyStoreSpecifiedWithoutHttpsPort() {
132-
new CommandLineOptions("--https-keystore", "/my/keystore");
133-
}
134-
135130
@Test(expected=Exception.class)
136131
public void throwsExceptionWhenPortNumberSpecifiedWithoutNumber() {
137132
new CommandLineOptions("--port");

0 commit comments

Comments
 (0)