Project: mule
Issue MULE-8173: Add protocol attribute to listener-config and request-config to improve usability
Currently is difficult for an user to realice how to configure HTTPS for listening HTTP requests or sending HTTP requests. The way to do that currently is by defining a TLS Context element (which can be empty for sending request, in such case it will use jvm default certificatess) inside the listener-config or de request-config element. That it's not straightforward if the user is working with XML and for users that do not know that SSL / TLS is the protocol behing HTTPS isn't either despite they use Studio. The idea is to add a protocol attribute (with default value HTTP) in the listener-config and the request-config. - Listener config: - if user sets protocol="http" or provides no values then we validate that the user didn't put a TlsContext. - If user sets protocol="https" we validate that the user provided a TlsContext with at least a keystore configured on it. - Request config: - if user sets protocol="http" or provides no value then we validate that the user didn't put a TlsContext - if user sets protocol="https" and provides no TlsContext config then we create a TlsContext by default (implicitly) using the default jvm certificates - if http is selected, port 80 is used by default - if https is selected, port 443 is used by default The usability improvements is: From Studio the user has a much more easy way to find where to define the use of HTTPS since it's going to be in the main configuration section of both listener-config and request-config From XML the user will see a hint from the XML content assistant to pick the protocol right in the listener-config element or request-config element. With the new behaviour there's no reason to support an empty tls:context element in the config. When we rebuild the current TCP transport ideally we can reuse the same mechanism as in HTTP (no idea what the "protocol" attribute would be called in that case) or add support for an empty tls:context again.
Story points: 5