You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Andrea (Jira)" <ji...@apache.org> on 2019/09/26 14:50:00 UTC
[jira] [Created] (FILEUPLOAD-301) Problems uploading files greater
than 100kb using HTTPS
Andrea created FILEUPLOAD-301:
---------------------------------
Summary: Problems uploading files greater than 100kb using HTTPS
Key: FILEUPLOAD-301
URL: https://issues.apache.org/jira/browse/FILEUPLOAD-301
Project: Commons FileUpload
Issue Type: Bug
Affects Versions: 1.2.2, 1.4
Environment:
Apache Tomcat 8.5
java 9.0.4
Windows Server 2016 Datacenter
Reporter: Andrea
I'have a java web app that uses Apache Commons FileUpload for uploading files using servlets.
My base code worked perfectly for years on a plain http environment (Apache Tomcat 8.5).
I've changed my environment to work with HTTPS, using a Let's Encrypt certificate using connector configured with org.apache.coyote.http11.Http11AprProtocol.
My uploads now suddenly fail if files are greater than 100kb. Same files uploaded successfully using plain HTTP environment.
This is the exception logged:
{{org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. java.io.IOException: The socket [925,024,592] associated with this connection has been closed.}}
this is the code fragment i use for manage request:
{{DiskFileItemFactory factory = new DiskFileItemFactory(); }}
{{File repository = (File) request.getServletContext().getAttribute("javax.servlet.context.tempdir"); factory.setRepository(repository); }}
{{ServletFileUpload upload = new ServletFileUpload(factory); upload.setHeaderEncoding(encoding); }}
{{multipartItems = upload.parseRequest(request);}}
Tomcat settings:
{{<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" />}}
{{}}
{{<Connector port="443" protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" SSLEnabled="true" > }}
{{<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> <SSLHostConfig> }}
{{<Certificate certificateKeyFile="D:/prj/certificati/private.key" certificateFile="D:/prj/certificati/certificate.crt" certificateChainFile="D:/prj/certificati/ca_bundle.crt" type="RSA" /> }}
{{</SSLHostConfig> }}
{{</Connector>}}
Thanks
--
This message was sent by Atlassian Jira
(v8.3.4#803005)