0

I am working a Java project which is deployed in Bluemix. I want to block all http calls (which are coming from a iOS mobile application in my usecase) and only allow https calls.

How can this be configured and enforced in Bluemix?

data_henrik
  • 16,724
  • 2
  • 28
  • 49
Murali
  • 165
  • 1
  • 14

2 Answers2

2

It is not possible to block http calls. You may want to consider handle it in your application code to route all HTTP traffic switch to HTTPS.

vmovva
  • 681
  • 3
  • 19
1

There are a variety of ways to address this problem described on IBM's developer works page.

Quoting from the accepted answer there:

The Bluemix proxy server terminates the SSL and so all traffic will look like HTTP to your app. However, the proxy also adds a special HTTP header named $WSSC with a value of either http or https. Simply check this header and, if the value is set to http, then redirect to the https version of your page.

UPDATE: The X-Forwarded-Proto header is now set as well.

There is also another answer there that describes how to do it via server.xml rather than application logic if you're pushing a full package that includes a custom server.xml (or are willing to).

Moldova
  • 1,641
  • 10
  • 13