@@ -180,7 +180,58 @@ public synchronized Service secure(String keystoreFile,
180180 String keystorePassword ,
181181 String truststoreFile ,
182182 String truststorePassword ) {
183- return secure (keystoreFile , keystorePassword , truststoreFile , truststorePassword , false );
183+ return secure (keystoreFile , keystorePassword , null , truststoreFile , truststorePassword , false );
184+ }
185+
186+ /**
187+ * Set the connection to be secure, using the specified keystore and
188+ * truststore. This has to be called before any route mapping is done. You
189+ * have to supply a keystore file, truststore file is optional (keystore
190+ * will be reused). By default, client certificates are not checked.
191+ * This method is only relevant when using embedded Jetty servers. It should
192+ * not be used if you are using Servlets, where you will need to secure the
193+ * connection in the servlet container
194+ *
195+ * @param keystoreFile The keystore file location as string
196+ * @param keystorePassword the password for the keystore
197+ * @param certAlias the default certificate Alias
198+ * @param truststoreFile the truststore file location as string, leave null to reuse
199+ * keystore
200+ * @param truststorePassword the trust store password
201+ * @return the object with connection set to be secure
202+ */
203+ public synchronized Service secure (String keystoreFile ,
204+ String keystorePassword ,
205+ String certAlias ,
206+ String truststoreFile ,
207+ String truststorePassword ) {
208+ return secure (keystoreFile , keystorePassword , certAlias , truststoreFile , truststorePassword , false );
209+ }
210+
211+ /**
212+ * Set the connection to be secure, using the specified keystore and
213+ * truststore. This has to be called before any route mapping is done. You
214+ * have to supply a keystore file, truststore file is optional (keystore
215+ * will be reused).
216+ * This method is only relevant when using embedded Jetty servers. It should
217+ * not be used if you are using Servlets, where you will need to secure the
218+ * connection in the servlet container
219+ *
220+ * @param keystoreFile The keystore file location as string
221+ * @param keystorePassword the password for the keystore
222+ * @param truststoreFile the truststore file location as string, leave null to reuse
223+ * keystore
224+ * @param needsClientCert Whether to require client certificate to be supplied in
225+ * request
226+ * @param truststorePassword the trust store password
227+ * @return the object with connection set to be secure
228+ */
229+ public synchronized Service secure (String keystoreFile ,
230+ String keystorePassword ,
231+ String truststoreFile ,
232+ String truststorePassword ,
233+ boolean needsClientCert ) {
234+ return secure (keystoreFile , keystorePassword , null , truststoreFile , truststorePassword , needsClientCert );
184235 }
185236
186237 /**
@@ -194,6 +245,7 @@ public synchronized Service secure(String keystoreFile,
194245 *
195246 * @param keystoreFile The keystore file location as string
196247 * @param keystorePassword the password for the keystore
248+ * @param certAlias the default certificate Alias
197249 * @param truststoreFile the truststore file location as string, leave null to reuse
198250 * keystore
199251 * @param needsClientCert Whether to require client certificate to be supplied in
@@ -203,6 +255,7 @@ public synchronized Service secure(String keystoreFile,
203255 */
204256 public synchronized Service secure (String keystoreFile ,
205257 String keystorePassword ,
258+ String certAlias ,
206259 String truststoreFile ,
207260 String truststorePassword ,
208261 boolean needsClientCert ) {
@@ -215,7 +268,7 @@ public synchronized Service secure(String keystoreFile,
215268 "Must provide a keystore file to run secured" );
216269 }
217270
218- sslStores = SslStores .create (keystoreFile , keystorePassword , truststoreFile , truststorePassword , needsClientCert );
271+ sslStores = SslStores .create (keystoreFile , keystorePassword , certAlias , truststoreFile , truststorePassword , needsClientCert );
219272 return this ;
220273 }
221274
0 commit comments