Issue
- Login issue when configuring the SSL on JBoss EAP 7.0
Environment
- Portal: Liferay DXP 7.0
- Application Server: JBoss EAP 7.0
- Operating System: Ubuntu 19.04
Resolution
Please Note: The following procedures and unofficial links involve customizations that are beyond the scope of Liferay Support. Please exercise approriate discretion in the use of this information.
-
Steps to configure SSL on JBoss EAP 7.0:
- Configure the Liferay DXP 7.0 portal on JBoss EAP 7.0 server
-
Enable the https protocol by Configuring the Liferay portal with Secure Sockets Layer
-
Part 1: Generate the SSL certificate
- Using Windows server
- Using Linux distribution
-
Troubleshooting: The below commands might be helpful to prepare the Keystore Certificate.
- Open the terminal from the directory where you want to create the SSL certificate. For example, JBOSS_HOME directory/
-
Command 1: Create Keystore using keytool
keytool -genkeypair -alias appserver -storetype jks -keyalg RSA -keysize 2048 -keypass changeit -keystore "/XXX/Liferay_HOME/JBOSS_HOME/identity.jks" -storepass changeit -dname "CN=appserver,OU=Sales,O=Systems Inc,L=R,ST=NC,C=US" -validity 730 -v
-
Command 2: Export Key Information into Certificate
sudo keytool -export -alias appserver -keypass changeit -file myserver.crt -keystore "/home/ilameena/Ilameena/D drive/Testing instance/DXP/DXP 70/Liferay_HOME/JBOSS_HOME/identity.jks"
Output: Certificate stored in file <myserver.cert> -
Command 3: Import certificate into security which has located inside the JRE because Server will always search certificate information in JRE which is used by the server.
sudo keytool -import -alias appserver -file myserver.crt -keypass changeit -keystore "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts"
Output: Trust this certificate? [no]: yes
The certificate was added to Keystore
-
Part 2: Configuring Jboss to use SSL
- Open the standalone.xml file [Navigate to Liferay_HOME/JBOSS_HOME/standalone/configuration]
-
Step 1: Add <security-realm> under the <security-realms> as follows
<security-realm name="HTTPSRealm">
<server-identities>
<ssl>
<engine enabled-protocols="TLSv1.1"/>
<keystore path="/home/ilameena/Ilameena/D drive/Testing instance/DXP/DXP 70/Liferay_HOME/JBOSS_HOME/keystore.jks" keystore-password="changeit" alias="jboss"/>
</ssl>
</server-identities>
</security-realm> -
Step 2: Add <https-listener > next to the <http-listener> under <subsystem xmlns="urn:jboss:domain:undertow:3.1">
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<https-listener name="https" secure="true" enabled-protocols="TLSv1.1,TLSv1.2" security-realm="HTTPSRealm" socket-binding="https"/> -
Step 3: If you need to access the portal from domain and IP both in the JBOSS environment, you need to provide your IP address in standalone.xml under <interface name="public"> tag. Ex: Add <any-address/> under <interface name="public">
<interface name="public"> <any-address/> </interface>
or
Step 3: Another better option is to not restrict it to IP or domain by setting public interface to any-address tag. Ex: Add <inet-address value="${jboss.bind.address.management:YOUR_IP_ADDRESS}"/> under <interface name="public">
<interface name="public"> <inet-address value="${jboss.bind.address.management:YOUR_IP_ADDRESS}"/> </interface>
Save the standalone.xml file
-
Part 3: Mapping the IP or domain as per the requirement
-
If you need to access the portal from domain and IP both in the JBOSS environment, you need to provide your IP address in standalone.xml under <interface name="public"> as PART 2 and configure your IP in the host file along with the domain.
This way it should be accessible to both IP and domain.
-
Once you are ready to go with the configured SSL connection. Clear the temp directories and start the Jboss server.
- Hit the URL to check the connection: https://IP:port or https://Domain:port
-
-
Part 1: Generate the SSL certificate
Additional Information
-
Important Notes:
- If you are getting redirect URL is not allowed exceptions in the console while you are accessing your application server directly by hitting through IP: port or Domain: port, add the redirect.URL Liferay properties in the portal-ext.properties as per your requirement that is either with Ip mode or Domain mode.
- Clear the temp directories and start the server to check the portal behavior
- Other unofficial links for the reference: