[
https://issues.apache.org/jira/browse/NIFI-2525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15432127#comment-15432127
]
ASF GitHub Bot commented on NIFI-2525:
--------------------------------------
GitHub user ijokarumawak opened a pull request:
https://github.com/apache/nifi/pull/915
NIFI-2525: Fix Proxy auth issue with async send.
Without this fix, NiFi fails to send data via HTTP Site-to-Site through
Proxy which requires authentication due to AsynchronousCloseException.
It happens when async client replays producing contents in order to re-send
the
request with auth credential for the proxy server, however the
connection is already closed.
This fix makes NiFi to send actual data only at the second round of
requests, so that flow-file
contents can be sent without reading it twice.
Unit test cases using LittleProxy are also added to confirm HTTP
Site-to-Site works with Proxy with/without authentication.
I've tested with Apache mod_proxy and Squid proxy servers with basic/digest
auth.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ijokarumawak/nifi nifi-2525
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/915.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #915
----
commit 12cf7ef186440ef5de07b04ecaa33d93846ece6f
Author: Koji Kawamura <[email protected]>
Date: 2016-08-23T01:57:57Z
NIFI-2525: Fix Proxy auth issue with async send.
Without this fix, NiFi fails to send data via HTTP Site-to-Site through
Proxy which requires authentication due to AsynchronousCloseException.
It happens when async client replays producing contents in order to re-send
the
request with auth credential for the proxy server, however the
connection is already closed.
This fix makes NiFi to send actual data only at the second round of
requests, so that flow-file
contents can be sent without reading it twice.
----
> HTTP Site-to-Site fails with java.nio.channels.AsynchronousCloseException
> when sending through proxy that requires authentication
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-2525
> URL: https://issues.apache.org/jira/browse/NIFI-2525
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.0.0
> Reporter: Koji Kawamura
>
> Pulling data using Remote Process Group from output port works.
> However, pushing data using Remote Process Group to input port fails with
> AsynchronousCloseException.
> A RPG sends data via POST, then a proxy server returns 407: proxy auth
> required. After this, the RPG should resend the request with credential, but
> the data channel is already closed.
> Currently, it uses chunked encoding so that it can stream data to send.
> Sending actual data twice won't be efficient. We need to do the
> authentication before start reading flow-file stream.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)