Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified
Accepted Solution

TLSIOException with reason '0' and no stack trace on WiFi

Hello,

 

I am uploading a file via SSL. On most devices the file is transmitted without any problems. On probably 20% of devices, file transmission fails with a TLSIOException with no stack trace and no message. Running TLSException.getReason()  returns '0'. There is no common denominator to the problem like OS version or bundle, or device model, except for that it never fails over a cellular connection - only on WiFi.

 

I'm out of tricks for debugging this issue. Any thoughts would be appreciated.

 

Scott

Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: TLSIOException with reason '0' and no stack trace on WiFi

I noticed that the time was wrong on the devices that threw the TLSIOException and I was able to avoid getting that exception by issue by changing the date and time to the present. However, this resulted in IOException: ConnectionClosed being thrown on the line where I read from the InputStream (I was aware of the ConnectionClosed issue occurring on some devices). I found that I couldn't open both an InputStream and OutputStream on the same SSL connection. If I opened the InputStream first and the OutputStream second, I could read from the InputStream successfully but writing the the OutputStream would fail. If I opened the OutputStream first and the InputStream second, the opposite would occur. From here, I implemented the solution outlined in this thread:
 
 
This appears to have solved the issue completely and I am successfully uploading on all devices so far.
 
Scott