I need to disable HTTP on the Operator Console and only allow HTTPS. I have configured the certificates for HTTPS and it works fine but HTTP is still accessible. How can I disable HTTP or redirect to HTTPS?
Operator Console / wasp probe - any version
The steps are as follows:
<security-constraint>
<web-resource-collection>
<web-resource-name>un restricted methods</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
Note: in most cases the redirectPort value will be 443 but this may be set to a nonstandard port. It must match the actual HTTPS port you are using, defined by the setting for https_port which is set in wasp.cfg.
Important Notes
Once you have made the changes to the web.xml files HTTP will be disabled even if you remove the redirectPort and you will have to undo the changes. You cannot have both HTTP and HTTPS enabled with the redirect in place. HTTP will be totally disabled.
If you need HTTP and HTTPS to be available then you must leave the web.xml files alone and do not enable this redirect, and end users will have the option to choose either one.
More information about this and enabling HTTPS in general for Admin Console and Operator Console can be found here.
Admin Console does not support this functionality.
For Admin Console, the only option is to remove the "http_port" key from wasp.cfg so that only the HTTPS port will be available. Users navigating to the HTTP URL will receive a "Page Not Found" error.
Tips
In Windows, you can do a search for "web.xml" from the webapps folder to display all of them at once (go to View->Details in the File Explorer to see the paths as shown below):
If you have the Notepad++ text editor, you can highlight all of these and select "Edit in Notepad++" to open them at once.
Then search-and-replace <transport-guarantee>NONE</transport-guarantee> and replace with <transport-guarantee>CONFIDENTIAL</transport-guarantee> across all of them at once.
In Linux, you can do the following: