为什么 WSO2 API 管理器使用 8243 而不是 443 调用已注册 HTTPS API 的端点?我无法到达我的最终服务

Why WSO2 API Manager call the endpoint of a registered HTTPS API using 8243 instead 443? I can't reach my final service

我发现 WSO2 API Manager 存在以下问题(我正在使用 WSO2 API Manager 6.2.0 版本)。

我在发布者门户上发布了 API。此 API 期望 POST 请求通过 HTTPS 协议并将 JSON 负载作为请求主体.

问题是已发布的 API 生成了这样的 cURL 请求:

curl -k -X POST "https://MY_SERVER:8243/puntualitest/v1.0.0/puntuali" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"header\": { \"msgUid\": \"a36bea3f-6dc6-49d7-9376-XXXXXXX\", \"timestamp\": 1567060509108, \"metadata\": { \"TRACKER_BIZID_REV_CODICE\": \"7175\", \"TRACKER_BIZID_REV_NUMERO\": \"545/2019\" }, \"codApplication\": null, \"codEnte\": null, \"invocationContext\": null, \"caller\": \"SRW\", \"user\": null, \"service\": \"crediti.invioPosizioneCreditoria\" }, \"body\": { \"@dto\": \"binary\", \"content\": \"PD94bWwgdmVyc2lvbj..............+\" }}"

问题是,如您所见,它试图调用 8243 端口上的最终端点,而不是预期的 443 端口,即标准 HTTPS 端口。

因此此调用以 Connection refused 消息错误结束,因为最终端点侦听 443 而不是 8243.

所以我有一些问题:

  1. 为什么 WSO2 API 管理器尝试调用 8243 而不是 443[=48 上的最终端点=] 端口,如果选择的协议是 HTTPS,理论上,它适用于 443?

  2. 有没有办法设置必须使用的最终端点端口是443?

谢谢

如果您采用生产案例,您的网关将通过负载均衡器公开,并在端口 443 中公开。您可以从 lb 对 8243 网关服务器进行负载均衡。您可以参考[1]设置负载均衡器。

如果需要,您可以更改端口 8280 和 8243。为此,您可以在位于 repository/conf/axis2 位置的 axis2.xml 文件中更改它们。

<transportReceiver name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpListener">
        <parameter name="port" locked="false">8280</parameter>
        <parameter name="non-blocking" locked="false">true</parameter>
        <!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
        <!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
        <parameter name="httpGetProcessor" locked="false">org.wso2.carbon.mediation.transport.handlers.PassThroughNHttpGetProcessor</parameter>
        <!--<parameter name="priorityConfigFile" locked="false">location of priority configuration file</parameter>-->
    </transportReceiver>

在端口值中,您可以将其更改为 80,对于端口 8243 的 https 也可以找到类似的定义。

[1] - https://docs.wso2.com/display/AM210/Configuring+the+Proxy+Server+and+the+Load+Balancer#ConfiguringtheProxyServerandtheLoadBalancer-Step2-Configuretheloadbalancer/reverseproxyserver