How to configure ssl in wildfly 10

To generate self signed ceritificate use keytoolkey and certificate management tool.

keytool -genkeypair -alias serverkey -keyalg RSA -keysize 2048 -validity 365 -keystore keystore.jks -keypass mypassword -storepass mypassword -dname "CN=Server Administrator,O=My Organization,C=UA"

dname refer to the subject’s Common Name, Organization, and Country.

Move generated file keystore.jks to WildFly configuration dir.

mv keystore.jks $JBOSS_HOME/standalone/configuration/

Configure HTTPS in WildFly using JBoss CLI:

/core-service=management/security-realm=ssl-realm/:add()
/core-service=management/security-realm=ssl-realm/server-identity=ssl/:add(keystore-path=keystore.jks, keystore-relative-to=jboss.server.config.dir, keystore-password=mypassword, alias=serverkey, key-password=mypassword)
/subsystem=undertow/server=default-server/https-listener=https/:add(socket-binding=https, security-realm=ssl-realm)