Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Elytron: A New Security Framework in WildFly/JBoss EAP

April 20, 2018
Siddhartha De
Related topics:
Security
Related products:
Red Hat JBoss Enterprise Application Platform

    Elytron is a new security framework that ships with WildFly version 10 and Red Hat JBoss Enterprise Application Platform (EAP) 7.1. This project is a complete replacement of PicketBox and JAAS. Elytron is a single security framework that will be usable for securing management access to the server and for securing applications deployed in WildFly. You can still use the legacy security framework, which is PicketBox, but it is a deprecated module; hence, there is no guarantee that PicketBox will be included in future releases of WildFly. In this article, we will explore the components of Elytron and how to configure them in Wildfly.

    The Elytron project covers the following: 

    • SSL/TLS
    • Secure credential storage
    • Authentication
    • Authorization

    In this article, we are going to explore using SSL/TLS in WildFly with Elytron.

    The key attribute here is SSLContext, which also has the reference the following component:

    • Key-Manager:  key-manager keeps the reference of key-store to be used and load the keys.
    • Trust-Manager: This also keeps the reference of key-store, basically used for trustCertificates. If all the certificates are present in the keystore referenced by key-manager, configuring trust-manager is not required. However, for outbound connections, a trust-manager can be used.
    • Security-Domain: This is an optional parameter,  However, if SSLContext is configured with a reference to a security-domain, then the verification of a client's certificate can be performed as an authentication, thus ensuring the appropriate permissions for a login are assigned before even allowing the connection to be fully opened.

    SSLContext also defines the type of SSL communication (one-way/two-way) along with allowed protocol and cipher-suite details.

    Configure the SSLContext to Be Used by the Management Interface and the Undertow Subsystem 

    Before, we start configuring SSL/TLS in Elytron, we should have a certificate. In this tutorial, we will create a self-signed certificate to understand how SSL/TLS works in Elytron.

    To manage the certificate/keystore, I have used here keytool CLI-based utility that ships with Java. However, one can manage the certificate/keystore using another utility, such as  Portecle, which allows to manage the keystore/certificate graphically and does not require to remember long command lines.

    First, use keytool to generate the keystore and a self-signed certificate, executing a command similar to the following in the OS terminal command line:

    keytool -genkeypair -alias wildfly -keyalg RSA -sigalg SHA256withRSA -validity 365 -keysize 2048 -keypass jboss@123 -storepass jboss@123 -dname "CN=developer.jboss.org, C=IN" -ext san=dns:developers.redhat.org,dns:developers.wildfly.org -keystore wildfly.jks

    Note: This is just an example, you need to change the common name (CN) and other attribute as per your organization requirement and set the password accordingly.

    Once we are ready with the certificate/keystore, need to perform the following steps to configure the Elytron subsystem for enabling SSL/TLS. Here, I am demonstrating the configuration using the JBoss CLI.

    • First, we need to connect to the JBoss CLI by executing the jboss-cli command available in the directory $WildFly_Home/bin.
    • Next, configure a key-store component in the Elytron subsystem with the newly created keystore (here wildfly.jks is placed at $WildFly_Home/ssl).
    /subsystem=elytron/key-store=wildflyKS:add(type=JKS,path="${jboss.home.dir}/ssl/wildfly.jks",credential-reference={clear-text=jboss@123})
    • Then, create a new key-manager component in the Elytron subsystem referencing the key-store component created above. To do this, need to execute the command like below:

    /subsystem=elytron/key-manager=wildflyKM:add(algorithm=SunX509,key-store=wildflyKS,credential-reference={clear-text=jboss@123})

    Note: We are required to give the password (e.g. jboss@123) of keystore here while creating key-manager.

    • Finally, configure a new server-ssl-context referencing the key-manager component created in the previous step:
    /subsystem=elytron/server-ssl-context=wildlfySSC:add(key-manager=wildflyKM,protocols=[TLSv1.2])

    To enable SSL/TLS through Elytron, we are required to execute the following two commands to configure the Undertow https-listener and map the ssl-context with Elytron. By default, the https-listener is configured with the ApplicationRealm security realm, and by default, ApplicationRealm generates a self-signed certificate during the first startup of WildFly. You need to do batch execution, because both of the commands have to execute simultaneously, else you can remove the https-listener and add the https-listener again with ssl-context .

    batch
    /subsystem=undertow/server=default-server/https-listener=https:undefine-attribute(name=security-realm)
    /subsystem=undertow/server=default-server/https-listener=https:write-attribute(name=ssl-context,value=wildlfySSC)
    run-batch

    Now for the management interface to use the same ssl-context, we need to execute the following commands in the JBoss CLI, which will also enable SSL for the management interface:

    • Before, configuring ssl-context for the management-interface, we need to configure secure-port for the management-http interface for communicating over SSL/TLS
    /core-service=management/management-interface=http-interface:write-attribute(name=secure-socket-binding,value=management-https)
    • Map the same ssl-context with management-http interface for enabling SSL/TLS
    /core-service=management/management-interface=http-interface:write-attribute(name=ssl-context,value=wildflySSC)

    Now, to test your configuration and the SSL/TLS handshake, make a request over the HTTPS protocol using your browser. To do this, you can also use the openssl command-line utility, for example:

    openssl s_client -connect developers.redhat.com:8443

    You can also use the  SSL testing tool to check the certificate and the allowed protocol and ciphers. Once you have completed the setup, you can make your system live for the production usage.

    There are couple of features in Elytron that were not there in earlier JBoss versions:

    • Elytron prints a warning message in the log upon expiration of the certificate used in the Elytron subsystem.
    • It is possible to load the certificate keystore without restarting/reloading the instance, although there are still some challenges.
    • Elytron also provides the facility to check the certificate details.
    Last updated: June 22, 2023

    Recent Posts

    • Red Hat Hardened Images: Top 5 benefits for software developers

    • How EvalHub manages two-layer Kubernetes control planes

    • Tekton joins the CNCF as an incubating project

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.