Setting up the use of port 443 on a standard glassfish installation is fairly simple.
However, it is not possible to dedicate the use of port 443 solely to the mobile application. This port will therefore be used by all glassfish applications on the server.
Setting up port 443 does not prevent port 7181 from being used simultaneously.
All the configuration is done in the domain.xml file of the glassfish server, which is located in C:\Program Files\Gespage\GespageCore\server\payara41\glassfish\domains\domain1\config
The first step is to modify the network-listener file to add the use of port 443.
To do this, simply copy the line for port 7181, replace the port with 443 and give it a new name.
In our example, we'll call it ‘http-listener-3’:
<network-listeners>
<network-listener protocol="http-listener-1" port="7180" name="http-listener-1" thread-pool="http-thread-pool" transport="tcp"></network-listener>
<network-listener protocol="http-listener-2" port="7181" name="http-listener-2" thread-pool="http-thread-pool" transport="tcp"></network-listener>
<network-listener protocol="http-listener-2" port="443" name="http-listener-3" thread-pool="http-thread-pool" transport="tcp"></network-listener>
<network-listener protocol="admin-listener" port="4848" name="admin-listener" thread-pool="admin-thread-pool" transport="tcp"></network-listener>
</network-listeners>
Note that the protocol must remain http-listener-2, as this is the name of the protocol used for the secure https connection.
Finally, we simply need to define the use of this listener in the list for the connection to the server:
<virtual-server network-listeners="http-listener-1,http-listener-2,http-listener-3" id="server">
<property name="send-error_1" value="code=404 path=C:/Program%20Files/Gespage/GespageCore/server/config/docroot/404.html"></property>
<property name="docroot" value="C:/Program Files/Gespage/GespageCore/server/config/docroot"></property>
</virtual-server>
Finally, to take the new settings into account, you need to restart the Gespage services.
The server will then be accessible in https on port 7181 and 443 for both the mobile and the Gespage administration interface.