You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (Jira)" <ji...@apache.org> on 2020/10/21 18:18:00 UTC

[jira] [Commented] (HTTPCORE-651) javax.net.ssl.SSLException: SSL peer shut down incorrectly

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

Oleg Kalnichevski commented on HTTPCORE-651:
--------------------------------------------

[~henry.smith] How am I expected to be able to fix the problem that cannot be reproduced? Could you please at the very least post a _complete stack trace of the exception?

Oleg

> javax.net.ssl.SSLException: SSL peer shut down incorrectly
> ----------------------------------------------------------
>
>                 Key: HTTPCORE-651
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-651
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>         Environment: httpcore 4.5, ubuntu 16.04, open jdk 1.8
>            Reporter: Henry Smith
>            Priority: Major
>
> sometimes the httpcore library generates an exception 
>  
> javax.net.ssl.SSLException: SSL peer shut down incorrectly
>  
> during a file upload (when reading data from the input stream)
> HttpEntity entity = ((HttpEntityEnclosingRequest)httpRequest).getEntity();
> InputStream is = entity.getContent();
> int data;
> while(data!=-1){
> data = is.readData();
> }
> httpRequest is instance of org.apache.http.HttpRequest HttpRequest
>  
> Httpcore is used as a web server/file server, based on this example
> [https://hc.apache.org/httpcomponents-core-4.4.x/httpcore/examples/org/apache/http/examples/HttpFileServer.java]
> And users upload their files via their web browsers (using Ajax)
> var file=document.getElementById("file").files[0];
> var data = new FormData();
> data.append("file", file);
> xmlhttp.open("Post","upload",true);
> xmlhttp.send(data);
>  
> I have not managed to replicate the issue, in all our tests the httpcore works fine both in the development as well as production environment, however, in the production environment, this exception is sometimes experienced causing termination of the file upload (e.g. in the middle of the file upload i.e. half of the file already uploaded).
> By reading posts on different forums, this exception appear to be related when plain text sockets are wrapped in as ssl context, and when the server terminates the socket (i.e. it does not terminate the socket as the SSL socket but as plain text socket). Not sure whether that's applicable in this case, because, in majority of case, files are uploaded successfully.
> Additional observation, typically this issue happens to users located in developing countries, suggesting maybe some underlying network connectivity issues. It rarely happens to users located in developed countries. Any help will be much appreciated. Thanks.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org