@@ -88,7 +88,14 @@ public URI getExternalUri() {
88
88
int port = getPort ();
89
89
90
90
try {
91
- return new URI ((isSecure () || isSelfSigned ()) ? "https" : "http" , null , host , port , null , null , null );
91
+ return new URI (
92
+ (isSecure () || isSelfSigned ()) ? "https" : "http" ,
93
+ null ,
94
+ host ,
95
+ port ,
96
+ null ,
97
+ null ,
98
+ null );
92
99
} catch (URISyntaxException e ) {
93
100
throw new ConfigException ("Cannot determine external URI: " + e .getMessage ());
94
101
}
@@ -99,23 +106,28 @@ public boolean getAllowCORS() {
99
106
}
100
107
101
108
public boolean isSecure () {
102
- return config .get (SERVER_SECTION , "https-private-key" ).isPresent () && config .get (SERVER_SECTION , "https-certificate" ).isPresent ();
109
+ return config .get (SERVER_SECTION , "https-private-key" ).isPresent ()
110
+ && config .get (SERVER_SECTION , "https-certificate" ).isPresent ();
103
111
}
104
112
105
113
public File getPrivateKey () {
106
114
String privateKey = config .get (SERVER_SECTION , "https-private-key" ).orElse (null );
107
115
if (privateKey != null ) {
108
116
return new File (privateKey );
109
117
}
110
- throw new ConfigException ("you must provide a private key via --https-private-key when using --https" );
118
+ throw new ConfigException ("Please provide a private key via --https-private-key " +
119
+ "when using --https" );
111
120
}
112
121
113
122
public File getCertificate () {
114
- String certificatePath = config .get (SERVER_SECTION , "https-certificate" ).orElse (null );
123
+ String certificatePath = config
124
+ .get (SERVER_SECTION , "https-certificate" )
125
+ .orElse (null );
115
126
if (certificatePath != null ) {
116
127
return new File (certificatePath );
117
128
}
118
- throw new ConfigException ("you must provide a certificate via --https-certificate when using --https" );
129
+ throw new ConfigException ("Please provide a certificate via --https-certificate " +
130
+ "when using --https" );
119
131
}
120
132
121
133
public boolean isSelfSigned () {
0 commit comments