Isaac Cruz Ballesteros created HTTPCORE-727:
-----------------------------------------------
Summary: EndpointDetails.getReceivedBytesCount() won't work under
TLS
Key: HTTPCORE-727
URL: https://issues.apache.org/jira/browse/HTTPCORE-727
Project: HttpComponents HttpCore
Issue Type: Bug
Components: HttpCore NIO
Affects Versions: 5.1.4
Reporter: Isaac Cruz Ballesteros
Attachments: AsyncFileServerExample.java
When using TLS, endpointDetails.getReceivedBytesCount(), called on
disconnection(), always returns 0. I have modified AsyncFileServerExample
(attached) to enable TLS and get EndpointDetails to get that metric to
reproduce this issue.
After executing AsyncFileServerExample, I run
{noformat}
wget --no-check-certificate https://localhost:8080/xxx{noformat}
(it will get a 404), and the output is:
{noformat}
Sun, 30 Oct 2022 14:34:07 GMT | Listening on /[0:0:0:0:0:0:0:0]:8080
Sun, 30 Oct 2022 14:34:11 GMT | handle() EndpointDetails: sent=0, received=0
Sun, 30 Oct 2022 14:34:11 GMT | File .\xxx not found
Sun, 30 Oct 2022 14:34:11 GMT | disconnected() EndpointDetails: sent=252,
received=0 {noformat}
Notice how sent bytes is updated after handle(), but received is always 0.
This is the output when switching to HTTP:
{noformat}
Mon, 31 Oct 2022 08:09:29 GMT | Listening on /[0:0:0:0:0:0:0:0]:8080
Mon, 31 Oct 2022 08:09:46 GMT | handle() EndpointDetails: sent=0, received=114
Mon, 31 Oct 2022 08:09:46 GMT | File .\xxx not found
Mon, 31 Oct 2022 08:09:46 GMT | disconnected() EndpointDetails: sent=252,
received=114{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]