Add a warning an HTTPS connection is not used
Update RemoteClientConfiguration to warn the user that they really should be using HTTPS. See gh-3087
This commit is contained in:
parent
bdf7663a9a
commit
fe4c0022d7
|
|
@ -89,6 +89,10 @@ public class RemoteClientConfiguration {
|
|||
&& !remoteProperties.getRestart().isEnabled()) {
|
||||
logger.warn("Remote restart and debug are both disabled.");
|
||||
}
|
||||
if (!this.remoteUrl.startsWith("https://")) {
|
||||
logger.warn("The connection to " + this.remoteUrl
|
||||
+ " is insecure. You should use a URL starting with 'https://'.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -90,6 +90,12 @@ public class RemoteClientConfigurationTests {
|
|||
containsString("Remote restart and debug are both disabled"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void warnIfNotHttps() throws Exception {
|
||||
configureWithRemoteUrl("http://localhost");
|
||||
assertThat(this.output.toString(), containsString("is insecure"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void doesntWarnIfUsingHttps() throws Exception {
|
||||
configureWithRemoteUrl("https://localhost");
|
||||
|
|
|
|||
Loading…
Reference in New Issue