Skip to content

javax.net.ssl.SSLException on Android 4 #198

Closed
@andsh

Description

Android Upload Service version: 3.0.3
Android version and API version: 4.1.2 API 16
HTTP stack (e.g. HurlStack or OkHttpStack): standard Android

What did you expect?

My application worked well on all modern phones

What happened instead?

On this old phone I get different errors
error one:
Write error: ssl=0x4da61008: I/O error during system call, Broken pipe
10-04 19:06:07.919 5951-5951/bg.motolife.app W/System.err: javax.net.ssl.SSLException: Write error: ssl=0x4da61008: I/O error during system call, Broken pipe
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_write(Native Method)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:693)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at java.io.BufferedOutputStream.flushInternal(BufferedOutputStream.java:185)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:85)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:810)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at net.gotev.uploadservice.http.impl.HurlStackConnection.getServerResponseCode(HurlStackConnection.java:89)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at net.gotev.uploadservice.HttpUploadTask.upload(HttpUploadTask.java:72)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at net.gotev.uploadservice.UploadTask.run(UploadTask.java:139)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-04 19:06:07.939 5951-5951/bg.motolife.app W/System.err: at java.lang.Thread.run(Thread.java:856)

Error two:
10-04 19:42:00.359 17898-17898/bg.motolife.app E/gotev: onError null
10-04 19:42:00.359 17898-17898/bg.motolife.app W/System.err: java.io.EOFException
10-04 19:42:00.369 17898-17898/bg.motolife.app W/System.err: at libcore.io.Streams.readAsciiLine(Streams.java:203)
10-04 19:42:00.369 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560)
10-04 19:42:00.369 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813)
10-04 19:42:00.369 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at net.gotev.uploadservice.http.impl.HurlStackConnection.getServerResponseCode(HurlStackConnection.java:89)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at net.gotev.uploadservice.HttpUploadTask.upload(HttpUploadTask.java:72)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at net.gotev.uploadservice.UploadTask.run(UploadTask.java:139)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at java.lang.Thread.run(Thread.java:856)

Library initialization code:

public void onCreate() {
super.onCreate();
mInstance = this;
Fresco.initialize(this);
net.gotev.uploadservice.UploadService.NAMESPACE = bg.motolife.app.BuildConfig.APPLICATION_ID;
org.acra.ACRA.getErrorReporter().putCustomData("mlserial", Build.SERIAL);
PrefManager pref;
pref = new PrefManager(getApplicationContext());
org.acra.ACRA.getErrorReporter().putCustomData("mlphone", pref.getMobileNumber());
/FBL if (!org.acra.ACRA.isACRASenderServiceProcess()) {
com.facebook.FacebookSdk.sdkInitialize(getApplicationContext());
com.facebook.appevents.AppEventsLogger.activateApp(this);
}
/
}

Request code:

final String uploadId =
new net.gotev.uploadservice.MultipartUploadRequest(getApplicationContext(), "https://www.xxx.xxx/post_avatar.php")
.setCustomUserAgent("MotolifeBG " + System.getProperty("http.agent"))
.addFileToUpload(RegistrationFaceBook.this.getExternalFilesDir(null) + "/myavatardir/tmpavatar.jpg", "avatar")
.addParameter("phone",pref.getMobileNumber())
.addParameter("mltoken",pref.getMlToken())
.setDelegate(this).startUpload();

Where have you added the request code?

Activity

LogCat output

10-04 19:42:00.039 17898-17898/bg.motolife.app E/gotev: uploadId=6d4e1c7e-579b-4ad2-b123-9badc18b69dc
10-04 19:42:00.049 17898-21517/bg.motolife.app V/FA: Activity resumed, time: 4377682
10-04 19:42:00.119 17898-21895/bg.motolife.app I/dalvikvm: Could not find method java.net.HttpURLConnection.setFixedLengthStreamingMode, referenced from method net.gotev.uploadservice.http.impl.HurlStackConnection.setHeaders
10-04 19:42:00.119 17898-21895/bg.motolife.app W/dalvikvm: VFY: unable to resolve virtual method 44675: Ljava/net/HttpURLConnection;.setFixedLengthStreamingMode (J)V
10-04 19:42:00.119 17898-21895/bg.motolife.app D/dalvikvm: VFY: replacing opcode 0x6e at 0x000a
10-04 19:42:00.219 17898-17898/bg.motolife.app D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 0ms
10-04 19:42:00.259 17898-17898/bg.motolife.app D/dalvikvm: GC_EXPLICIT freed 1935K, 23% free 15274K/19591K, paused 3ms+3ms, total 46ms
10-04 19:42:00.259 17898-17898/bg.motolife.app E/gotev: onProgress eltstr=0s elt=22 ratestr=0 bit/s prc=0 tb=31089 ub=105
10-04 19:42:00.269 17898-17898/bg.motolife.app D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 0ms
10-04 19:42:00.319 17898-17898/bg.motolife.app D/dalvikvm: GC_EXPLICIT freed 5K, 23% free 15272K/19591K, paused 3ms+5ms, total 51ms
10-04 19:42:00.359 17898-17898/bg.motolife.app E/gotev: onError null
10-04 19:42:00.359 17898-17898/bg.motolife.app W/System.err: java.io.EOFException
10-04 19:42:00.369 17898-17898/bg.motolife.app W/System.err: at libcore.io.Streams.readAsciiLine(Streams.java:203)
10-04 19:42:00.369 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560)
10-04 19:42:00.369 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813)
10-04 19:42:00.369 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at net.gotev.uploadservice.http.impl.HurlStackConnection.getServerResponseCode(HurlStackConnection.java:89)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at net.gotev.uploadservice.HttpUploadTask.upload(HttpUploadTask.java:72)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at net.gotev.uploadservice.UploadTask.run(UploadTask.java:139)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-04 19:42:00.379 17898-17898/bg.motolife.app W/System.err: at java.lang.Thread.run(Thread.java:856)

Server side

PHP on Apache

Server log (if applicable)

No server activity from this old phone

Additional info

On Android 5.0 and 6.0 everything is ok

Metadata

Assignees

No one assigned

    Labels

    android bugAcknowledged bug which is seen in Upload Service, but it's caused by an underlying Android Bug

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions