1

I have tried in the api manager and in bluemix, returns this error:

API level schemes must be set to use only "https" enter image description here la URL de mi API es: http://54.91.49.213:9443/desarrollo/catalog/ordencompra/v1/grabar.

Is it possible to configure this in the datapower? , if yes, how would the configuration be?

dhuamanr24
  • 11
  • 2

2 Answers2

1

If you are using the free ApiConnect available in IBM Cloud, you must use https for every URL in any node (invoke, proxy and for publish URL too), also you can't modify anything in the datapower running below that public IBM Api Connect.

0

You need to create another (new) domain on your DataPower for http to https proxy (I suggest you don't do that on production).

  1. Create Multi-Protocol Gateway and a Multi-Protocol Gateway policy

  2. add the following XSL as a rule. (notice to replace my-awesome-lb with your LB on top of your gateway/s, or if it's one then the DNS or IP address of it)

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dp="http://www.datapower.com/extensions"
                xmlns:regexp="http://exslt.org/regular-expressions"
                extension-element-prefixes="dp" exclude-result-prefixes="dp regexp">

  <xsl:template match="/">
    <xsl:variable name="protocol" select="dp:variable('var://service/protocol')" />

    <xsl:if test="$protocol != 'https'">
      <xsl:variable name="hostHeader" select="dp:http-request-header('Host')" />
      <xsl:variable name="newUrlLocation" select="concat('https://my-awesome-lb.com', concat(substring-after($hostHeader,'http://'), dp:variable('var://service/URI')))" />
      <dp:set-variable name="'var://service/routing-url'" value="$newUrlLocation" />
    </xsl:if>
  </xsl:template>

</xsl:stylesheet>
  1. Go to advanced and make sure you have the following:

enter image description here

EliSherer
  • 1,597
  • 1
  • 17
  • 29