/** * Create and configure a HttpsListener object to the list of subresources * * @param key * The key for the HttpsListener resource * @return this */ @SuppressWarnings("unchecked") public T httpsListener(java.lang.String childKey) { httpsListener(childKey, null); return (T) this; }
/** * Create and configure a HttpsListener object to the list of subresources * * @param key * The key for the HttpsListener resource * @return this */ @SuppressWarnings("unchecked") public T httpsListener(java.lang.String childKey) { httpsListener(childKey, null); return (T) this; }
/** * Install a supplied HttpsListener object to the list of subresources */ @SuppressWarnings("unchecked") public T httpsListener(HttpsListenerSupplier supplier) { httpsListener(supplier.get()); return (T) this; }
/** * Install a supplied HttpsListener object to the list of subresources */ @SuppressWarnings("unchecked") public T httpsListener(HttpsListenerSupplier supplier) { httpsListener(supplier.get()); return (T) this; }
/** * Create and configure a HttpsListener object to the list of subresources * * @param key * The key for the HttpsListener resource * @param config * The HttpsListenerConsumer to use * @return this */ @SuppressWarnings("unchecked") public T httpsListener(java.lang.String childKey, HttpsListenerConsumer consumer) { HttpsListener<? extends HttpsListener> child = new HttpsListener<>( childKey); if (consumer != null) { consumer.accept(child); } httpsListener(child); return (T) this; }
/** * Create and configure a HttpsListener object to the list of subresources * * @param key * The key for the HttpsListener resource * @param config * The HttpsListenerConsumer to use * @return this */ @SuppressWarnings("unchecked") public T httpsListener(java.lang.String childKey, HttpsListenerConsumer consumer) { HttpsListener<? extends HttpsListener> child = new HttpsListener<>( childKey); if (consumer != null) { consumer.accept(child); } httpsListener(child); return (T) this; }
@Override public void postInitialize(Container.PostInitContext initContext) { if (this.keystorePassword != null & this.keystorePassword != null && this.alias != null) { ManagementCoreService management = (ManagementCoreService) initContext.fraction("management"); if (management == null) { throw new RuntimeException("HTTPS configured but org.wildfly.swarm:management not available"); } List<Server> servers = subresources().servers(); for (Server server : servers) { if (server.subresources().httpsListeners().isEmpty()) { if (server.subresources().httpListener("default").socketBinding().equals("http")) { server.httpsListener("default-https", (listener) -> { listener.securityRealm("SSLRealm"); listener.socketBinding("https"); }); } } } management.securityRealm("SSLRealm", (realm) -> { realm.sslServerIdentity((identity) -> { identity.keystorePath(this.keystorePath); identity.keystorePassword(this.keystorePassword); identity.alias(this.alias); }); }); } }
server.httpsListener("default-https", (listener) -> { listener.securityRealm("SSLRealm"); listener.socketBinding("https");
server.httpsListener("default-https", (listener) -> { listener.securityRealm("SSLRealm"); listener.socketBinding("https");