How to delete the PU protocol from Glassfish 3

I have created PU protocol on Glassfish server in order to serving SSL pages forcefully. The main issue is this is the only way to redirect all the non-http requests to https. I did not find any other option for ‘SSL forcing’ in Glassfish 3 version. But here I want to get the same domain.xml file without having the PU ( port unification) protocal enabled. Becasue we enabled many other customer variables on domain.xml and wanted to move all the ssl parts under the loadbalencer (ssl offloading)

1. How to create PU protocol to use force https

[root@web03 ~]# cd /var/glassfish/domains/domain1/config
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol –securityenabled=false http-redirect
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol-filter –protocol http-redirect –classname com.sun.grizzly.config.HttpRedirectFilter redirect-filter
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol –securityenabled=false pu-protocol
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol-finder –protocol pu-protocol –targetprotocol http-listener-2 –classname com.sun.grizzly.config.HttpProtocolFinder http-finder
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol-finder –protocol pu-protocol –targetprotocol http-redirect –classname com.sun.grizzly.config.HttpProtocolFinder http-redirect
[root@web03 ~]#/home/glassfish/bin/asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.protocol=pu-protocol​

Here is the reverse process of the activities remove PU protocol

1. Assuming that Glassfish is installed on (/home/glassfish/bin) folder and execute the below commands.

#/var/glassfish/bin/asadmin set  configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.protocol=http-listener-1
#/var/glassfish/bin/asadmin delete-protocol-finder  –protocol pu-protocol    http-redirect
#/var/glassfish/bin/asadmin delete-protocol-filter –protocol http-redirect redirect-filter
#/var/glassfish/bin/asadmin delete-protocol  pu-protocol
#/var/glassfish/bin/asadmin delete-protocol http-redirect

نوشته های مشابه