WSO2 Identity Server 5.11:无法通过代理使用HTTPOutputEventAdapter发布HTTP事件。

huangapple go评论70阅读模式
英文:

WSO2 Identity Server 5.11 : Unable to publish HTTP events through proxy with the HTTPOutputEventAdapter

问题

I am trying to add an event publisher to send SMS OTP as described in the documentation below:

<https://is.docs.wso2.com/en/5.11.0/develop/enable-verification-for-updated-mobile-number/#step-01-add-an-event-publisher-to-send-sms>

The api Im trying to call through this event publisher is behind a proxy, so I have added the properties http.proxy.host, http.proxy.port to its configuration as follows:

<?xml version="1.0" encoding="UTF-8"?>
<eventPublisher name="HTTPOutputEventAdapter" processing="enable"
statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
<from streamName="id_gov_sms_notify_stream" version="1.0.0"/>
<mapping customMapping="disabled" type="json"/>
<to eventAdapterType="http">
<property name="http.client.method">httpGet</property>
<property name="http.url">https://api_sms/resources</property>
<!---------------------- PROXY --------------------------->
<property name="http.proxy.host">xx.xx.xx.xx</property>
<property name="http.proxy.port">8080</property>
<!---------------------- PROXY --------------------------->
</to>
</eventPublisher>

It seems that the proxy configuration is ignored, since I receive a timeout error when the event publisher is triggered:

ERROR {org.wso2.carbon.event.output.adapter.core.OutputEventAdapter} - Event dropped at Output Adapter &#39;HTTPOutputEventAdapter&#39; for tenant id &#39;-1234&#39;, Connection timed out (Connection timed out) java.net.ConnectException: Connection timed out (Connection timed out) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:607) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:288) at sun.security.ssl.SSLSocketImpl.&lt;init&gt;(SSLSocketImpl.java:193) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:153) at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:172) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.wso2.carbon.event.output.adapter.http.HTTPEventAdapter$HTTPSender.run(HTTPEventAdapter.java:316) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

Am I using the correct proxy configuration? otherwise, how can I add proxy configuration to an http out event publisher?

Thanks in advance.

英文:

I am trying to add an event publisher to send SMS OTP as described in the documentation below :

<https://is.docs.wso2.com/en/5.11.0/develop/enable-verification-for-updated-mobile-number/#step-01-add-an-event-publisher-to-send-sms>

The api Im trying to call through this event publisher is behind a proxy, so I have added the properties http.proxy.host , http.proxy.port to its configuration as follows :

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;eventPublisher name=&quot;HTTPOutputEventAdapter&quot; processing=&quot;enable&quot;
statistics=&quot;disable&quot; trace=&quot;disable&quot; xmlns=&quot;http://wso2.org/carbon/eventpublisher&quot;&gt;
&lt;from streamName=&quot;id_gov_sms_notify_stream&quot; version=&quot;1.0.0&quot;/&gt;
&lt;mapping customMapping=&quot;disabled&quot; type=&quot;json&quot;/&gt;
&lt;to eventAdapterType=&quot;http&quot;&gt;
    &lt;property name=&quot;http.client.method&quot;&gt;httpGet&lt;/property&gt;
    &lt;property name=&quot;http.url&quot;&gt;https://api_sms/resources&lt;/property&gt;
    &lt;!---------------------- PROXY ---------------------------&gt;
    &lt;property name=&quot;http.proxy.host&quot;&gt;xx.xx.xx.xx&lt;/property&gt;
    &lt;property name=&quot;http.proxy.port&quot;&gt;8080&lt;/property&gt;
    &lt;!---------------------- PROXY ---------------------------&gt;
&lt;/to&gt;

</eventPublisher>

It seems that the proxy configuration is ignored, since I receive a timeout error when the event publisher is triggered :

ERROR {org.wso2.carbon.event.output.adapter.core.OutputEventAdapter} - Event dropped at Output Adapter &#39;HTTPOutputEventAdapter&#39; for tenant id &#39;-1234&#39;, Connection timed out (Connection timed out) java.net.ConnectException: Connection timed out (Connection timed out)
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:607)
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:288)
        at sun.security.ssl.SSLSocketImpl.&lt;init&gt;(SSLSocketImpl.java:193)
        at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:153)
        at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:172)
        at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
        at org.wso2.carbon.event.output.adapter.http.HTTPEventAdapter$HTTPSender.run(HTTPEventAdapter.java:316)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Am I using the correct proxy configuration ? otherwise , how can I add proxy configuration to an http out event publisher ?

Thanks in advance.

答案1

得分: 1

你应该面对的问题已在https://github.com/wso2/product-is/issues/9598中报告。根据我的分析,该问题存在于5.11.0版本中。

你将需要使用6.0版本或通过构建源代码来应用修复补丁。以下是创建自己补丁的指南:https://stackoverflow.com/questions/33521560/how-do-you-create-your-own-patches-for-wso2-identity-server。

附注:如果你是WSO2的订阅客户,你可以通过产品更新联系WSO2获取5.11.0版本的修复补丁。

英文:

You should be facing the issue reported in https://github.com/wso2/product-is/issues/9598. As per my analysis, the issue exists in 5.11.0.

You will have to use 6.0 or apply the fix as a patch by building the source code. Here is a guide for building your own patches; https://stackoverflow.com/questions/33521560/how-do-you-create-your-own-patches-for-wso2-identity-server.

PS: If you are a subscription customer of WSO2, you might contact WSO2 for a fix for 5.11.0 via product updates.

huangapple
  • 本文由 发表于 2023年5月11日 01:01:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76220951.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定