[ 
https://issues.apache.org/jira/browse/HTTPCORE-706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17476671#comment-17476671
 ] 

Arunan Sugunakumar commented on HTTPCORE-706:
---------------------------------------------

Hi Oleg,

I am still struggling to create an exact reproducer for my issue. But I found 
this ticket[1], where the description matches my problem. As it says, the Read 
mask is removed despite the remainder of the decrypted payload being available 
in the {{SSLIOSession }}{{inPlain }}buffer. I assume that this issue is still 
there for Chunked responses.

Also, another new finding that I made was the "endOfInput"[2] method in 
NHttpClientEventHandler is never triggered in the newer versions when the 
connection is closed by the opposite endpoint. I used the code 
([^asyncbugtest.zip]) provided in [1], and ran it with httpcore-nio versions 
4.4.9 and 4.4.15. As you can see in the below screenshots,  endOfInput method 
is triggered in 4.4.9 and not in 4.4.15.

*4.4.9*

!Screenshot 2022-01-15 at 23.29.23.png|width=849,height=271!

*4.4.15*

!Screenshot 2022-01-15 at 23.28.36.png|width=849,height=227!

 

Can this be reason for my issue?  Your feedback is highly appreciated. 

[1] - https://issues.apache.org/jira/browse/HTTPCORE-600

[2] - 
[https://github.com/apache/httpcomponents-core/blob/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientEventHandler.java#L138]

Thanks & Regards,
Arunan

> Receiving incomplete payload from the backend after httpcore-nio version 
> upgrade
> --------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-706
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-706
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.4.15
>            Reporter: Arunan Sugunakumar
>            Priority: Major
>         Attachments: Screenshot 2022-01-15 at 23.28.36.png, Screenshot 
> 2022-01-15 at 23.29.23.png, asyncbugtest.zip
>
>
> Hi,
> We recently migrated to httpcore-nio 4.4.14 and we have been encountering 
> some issues when connecting to a HTTPS Backend that sends chunked responses. 
> The backend behaves in such a manner that when it sends the response, it 
> immediately closes the connection after completion. 
> When we debugged the code we found out that the ChunkDecoder never completes, 
> hence we are receiving the payload in half. In SSLEnginImpl, when the 
> close_notify event _"RECV TLSv1.2 ALERT:  warning, close_notify"_ is 
> received, it makes the _sslEngine.isInboundDone()_ as true. There are couples 
> of fixes[1][2] done in SSLIOSession class which makes the SSLIOSession into 
> _CLOSING_ state[3] and makes _endOfStream_ as true[4]. As a result, 
> ChunkDecoder never gets completed and the connection gets closed before 
> receiving the complete payload. This worked completely fine when we were 
> using httpcore-nio 4.3.3.
> I will try to provide a simplified version of the code that reproduces the 
> issue. In the meantime, is it possible to provide your feedback on whether 
> such behavior is expected?
> [1] - 
> https://github.com/apache/httpcomponents-core/commit/08d9c3c30d57def4963d0807bce5f3023f5fcb35
> [2] - 
> [https://github.com/apache/httpcomponents-core/commit/01f3d30cfa3b1bf643a8ea5733fdd3bde8c56abd]
> [3] - 
> [https://github.com/apache/httpcomponents-core/blob/4.4.14-RC2/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java#L380]
> [4] - 
> [https://github.com/apache/httpcomponents-core/blob/4.4.14-RC2/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java#L527]
>  
> Thanks & Regards,
> Arunan



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to