Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http.nonProxyHosts not available for https transportSender #106

Closed
isurul28 opened this issue May 24, 2022 · 2 comments · Fixed by wso2/product-micro-integrator#2715
Closed

Comments

@isurul28
Copy link

isurul28 commented May 24, 2022

Description:

In the deployment.toml file under the [transport.http] we have below properties to configure to let traffic go through a HTTP proxy server[1]

sender.proxy_host
sender.proxy_port
Like wise we have below properties to let traffic go through a HTTPS proxy server

sender.secured_proxy_host
sender.secured_proxy_port
Issue :
Also there is parameter named sender.non_proxy_hosts where we can put a list of hosts to which the HTTP traffic should be sent directly without going through the proxy server.

But when we apply the sender.non_proxy_host its only getting applied to HTTP transport sender. Its not getting applied to HTTPS transport sender. (sample deployment.toml file and resulting axis2.xml file is attached)
Further checking key-mapping.json file and axis2.xml.j2 file i can see that only below are available for HTTPS transport sender


"transport.http.sender.hostname_verifier": "transport.https.sender.parameter.'HostnameVerifier'",
  "transport.http.sender.secured_protocols": "transport.https.sender.parameter.HttpsProtocols",
  "transport.http.sender.secured_proxy_host": "transport.https.sender.parameter.'http.proxyHost'",
  "transport.http.sender.secured_proxy_port": "transport.https.sender.parameter.'http.proxyPort'",

The sender.non_proxy_host is not mapped for https sender in the key-mapping file.

After adding the below modification to axis2.xml.j2 file located in the path <MI_HOME>/repository/resources/conf/templates/conf/axis2/ directory. We can see the http.nonProxyHosts in the axis2.xml file under https sender. Also the use-case is working
Modification : (below snippet added to https sender)

{% if transport.http.sender.non_proxy_hosts is defined %}
        <parameter name="http.nonProxyHosts" locked="false">{% for parameter_value in transport.http.sender.non_proxy_hosts %}{{parameter_value}}{% if loop.index < transport.http.sender.non_proxy_hosts|length %}|{% endif %}{% endfor %}</parameter>
        {% endif %}

[1].https://apim.docs.wso2.com/en/latest/reference/config-catalog-mi/#https-transport-non-blocking-mode

Steps to reproduce:

1.Create a proxy server as mentioned in [2].
2.Send HTTPS request to the configured proxy server via MI

[2].https://ei.docs.wso2.com/en/latest/micro-integrator/setup/configuring_proxy_servers/

Affected product version:

MI 4.X

Affected component:

Environment details (with versions):

  • OS:
  • Client:
  • Env (Docker/K8s):

Optional fields

Related issues:

Suggested labels:

Suggested assignees:

@github-actions
Copy link

This issue is NOT closed with a proper Resolution/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Resolution/Cannot Reproduce - Issue cannot be reproduced.
      - Resolution/Duplicate - Issue is already reported before.
      - Resolution/Fixed - Issue has already been fixed.
      - Resolution/Answered - Issue has already been answered.
      - Resolution/Invalid - Issue is invalid.
      - Resolution/Not a bug - Issue is not a bug.
      - Resolution/Postponed - Issue is postponed.
      - Resolution/Won’t Fix - Issue won't be fixed.

@github-actions github-actions bot reopened this Jun 21, 2022
@YasasRangika YasasRangika added 4.3.0 4.3.0-M1 4.3.0 M1 Milestone labels Jan 8, 2024
@YasasRangika
Copy link

Closing this issue as the master branch PR: wso2/product-micro-integrator#2715 has already been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants