title: Dynamically switch http:listener-config configuration in mule
body: <p>I would like to have the ability to switch listener configuration easily  in Mule (CE-3.6.1) from http to https (with basic autentication). I've created a variable in the mule-project.xml 'mule.protocol' and two properties files http.properties and https.properties with some data like port (the same port in http and https), host, password, etc.</p>
  
  <p>in config.xml I have:</p>
  
  <pre><code>&lt;context:property-placeholder location="${mule.protocol}.properties" /&gt;
  
   &lt;http:listener-config name="HTTP_Listener_Configuration" host="${host}" port="${port}" doc:name="HTTP Listener Configuration" protocol="${protocol}"&gt;    
      &lt;tls:context&gt;
          &lt;tls:key-store type="${keystore.type}" path="${keystore.path}"  keyPassword="${keystore.keyPassword}" password="${keystore.password}" /&gt;
      &lt;/tls:context&gt;         
  &lt;/http:listener-config&gt;
  </code></pre>
  
  <p>but I have two problems. 
  First, I get a message: Value '${protocol}' is not man-valid with respect to enumeration '[HTTP, HTTPS]'
  and the second, section 'tls:context' is permitted only in https case, so I would have to hide it dynamically. How to solve these problems or whether there is another way to easily switch between the configuration of http and https? I'm using HTTP_Listener_Configuration in many services.</p>