Switchyard Web Service access redirect http to https

Solution Verified - Updated -

Issue

  • We have quite a few web services implemented and deployed as Switchyard apps. We have configured SSL to access these services using HTTPS on port 8443. That is working fine.

  • Now we would like to redirect any HTTP access to these web services to be redirected to HTTPS. For that, in standalone.xml HTTP connector has been configured to redirect to 8443 port. However as per the documentation security-constraint is also needed to be configured in web.xml in order for redirect to work.
    However since switchyard projects dont have web.xml , we am not sure where to put that configuration . Could you let me know where to configure security-constraint or any equivalent setting in switchyard.xml ?

  • Below is the SSL setting in standalone.xml

<subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="true">
 <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="8443"></connector>
 <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" enable-lookups="false" secure="true">
   <ssl name="test-ssl" key-alias="ssl" password="<pwd>" certificate-key-file="../standalone/test.keystore" protocol="TLSv1"/>
 </connector>
 <virtual-server name="default-host" enable-welcome-root="true">
 <alias name="localhost"></alias>
 <alias name="example.com"></alias>
 /virtual-server>
</subsystem>

Environment

  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.0.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content