Return-Path: Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 62586 invoked from network); 7 Mar 2003 02:22:22 -0000 Received: from unknown (HELO marineroad.com) (202.216.244.115) by daedalus.apache.org with SMTP; 7 Mar 2003 02:22:22 -0000 Received: from [192.168.0.140] ([192.168.0.140]) by marineroad.com (8.12.6/8.12.6) with ESMTP id h272PFrH046077 for ; Fri, 7 Mar 2003 11:25:15 +0900 (JST) (envelope-from yuui@marineroad.com) Date: Fri, 07 Mar 2003 11:22:08 +0900 From: TANAKA Yuui To: Commons HttpClient Project Subject: Problem with MultipartPostMethod via HTTPS Message-Id: <20030307105124.D661.YUUI@marineroad.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.05.06 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I tried to send a file to a servlet with MultipartPostMethod via HTTPS, then I get: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at com.sun.net.ssl.internal.ssl.InputRecord.a(DashoA6275) at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA6275) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275) at com.sun.net.ssl.internal.ssl.AppInputStream.read(DashoA6275) at java.io.FilterInputStream.read(FilterInputStream.java:111) at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:142) at java.io.FilterInputStream.read(FilterInputStream.java:90) at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:161) at org.apache.commons.httpclient.HttpMethodBase.getResponseBody(HttpMethodBase.java:667) at org.apache.commons.httpclient.methods.GetMethod.getResponseBody(GetMethod.java:293) at org.apache.commons.httpclient.HttpMethodBase.getResponseBodyAsString(HttpMethodBase.java:717) at Main.sendFile(Main.java:89) Here is the code: HttpClient httpClient = new HttpClient(); HostConfiguration hostConfig = httpClient.getHostConfiguration(); hostConfig.setHost("192.168.0.3", 443, "https"); MultipartPostMethod multipartPostMethod = new MultipartPostMethod(); multipartPostMethod.setPath("/hogecontext/upload"); File file = new File("/var/tmp/hoge.xml"); String fileName = file.getName(); try { FilePart filePart = new FilePart(fileName, fileName, file); } catch (FileNotFoundException e) { e.printStackTrace(); } int statusCode = -1; String str = null; try { statusCode = httpClient.executeMethod(multipartPostMethod); str = multipartPostMethod.getResponseBodyAsString(); // Line: 89 } catch (HttpException e) { e.printStackTrace(); } finally { multipartPostMethod.releaseConnection(); } Sending via HTTP is OK, but Sending via HTTPS caused the error. What is the proper way to get MultipartPost via HTTPS working? -- Marineroad Inc. / TANAKA Yuui