04-17-2012 12:54 PM - edited 04-17-2012 12:55 PM
I've developed an app that is used to upload pictures on the server by using HTTPS connections that stopped working suddenly last week for a bunch of users.
I've three BB devices and I can replicate the issue that the users are reporting only on one of those devices. (The issue it's not related to a specific OS version, or device model).
That's said, I'm getting the following error on the Java version of the app: net.rim.device.cldc.io.ssl.TLSIOException
And the following is the app log:
[253.453] SSL:->CH [253.687] SSL:<-SH [254.039] SSL:<-SC [254.14] SSL:<-SKE [254.148] SSL:CKE [254.226] SSL:->CCS [254.234] TLS:->F [254.64] TLS:<-F 20120413T001618Z [ERROR] [net.rim.device.cldc.io.ssl.TLSIOException] XmlRpcClient.execute Error 20120413T001619Z [ERROR] SSL communication error 20120413T001620Z [ERROR] >>> Logging the certificate details 20120413T001620Z [ERROR] SSL certificate not accepted. Reason: 0, certificate: null 20120413T001621Z [ERROR] Reason: 0 20120413T001622Z [ERROR] Certificate is null! 20120413T001623Z [ERROR] <<< Logging the certificate details
I enabled the debug mode on the nginx server, and noticed the following error message when the upp tried to connect to the server:
2012/04/16 21:14:38 [info] 20893#0: *359 SSL_read() failed (SSL: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac), client: 151.XX.XXX.XXX, server: _, request: "POST /xmlrpc.php HTTP/1.1", host: "XXX.XXX"
I thought it was an issue of the certificate installed on the server, and so I've installed the server side php app (WordPress) locally on a simple installation of XAMMP. I've enabled the SSL support by using a self-signed certificate. Unfortunately, the app works fine on HTTP, but doesn't work with HTTPS.
Still not happy with the tests I did, I thought to created a simple WebWorks app that send pictures to the server by using POST requests. I created that new app on a completely different dev env (OSX), only the signing keys are the same of the Java app.
The following is the error message I'm getting on the WebWorks app:
Code: 500
name: Error requesting resource.
I tried to upload pictures by using the HTTP protocol, and like the Java app, everything works fine on HTTP.
For the sake of precision I'm having this issue on a Bold9900 over WiFi. The same app installed on a Curve 9300 and on a Curve 8900 is still working fine .
I'm running out of idea, any thoughts?
04-19-2012 11:23 AM
Are you using a self signed certificate on the server as well? A BlackBerry Enterprise Server administrator can set an IT Policy that prevents connections made through untrusted certificates.
You say it just started happening. What changed recently? Did it ever work on these devices or is this a new BlackBerry model and/or OS that you haven't ran the application on before?
Which BlackBerry handheld software version are you testing on? You can find this under Options, About on the BlackBerry Smartphone.
04-19-2012 12:06 PM - edited 04-19-2012 12:07 PM
Are you using a self signed certificate on the server as well?
We are not using a self-signed certificate on our server.
You say it just started happening. What changed recently? Did it ever work on these devices or is this a new BlackBerry model and/or OS that you haven't ran the application on before?
The app was working fine on those devices till 9th April. Then stopped working only on HTTPS ( I can post pictures on HTTP without issue). We didn't change the server configuration/software, in fact our (Android | iOS | WinPhone7 | WebOS | Nokia) apps are still working fine.
Which BlackBerry handheld software version are you testing on?
I've 3 BB devices and the app stopped working only on one of those: - BB 9900 7.0 ( Applications: v7.0.0.296 - Platform 5.0.0.496 ) I've tried to upgraded this device with the BlackBerry Handheld Software v7.0.0.2406 ( Applications: 7.0.0.585 - Software Platform: 5.0.0.734) but the issue was still there. I also did a device wipe.
Users with the following devices are reporting the same issue:
04-19-2012 01:14 PM
You mentioned that you were testing over WiFi. Do you see different behaviour depending on the transport route being used (BES, WiFi, direct TCP, WAP 2.0) or do all fail on the devices with issues?
04-19-2012 02:45 PM
04-20-2012 08:56 AM
How are you opening the connection? Can you provide a code sample?
04-20-2012 02:16 PM
Attached is a sample application that uses the 4 different options to establish a secure connection. Give this a try and let me know the results.
Note that you'll need to change the server used in the URL and page in the GET command to point to your server.
I built this using BlackBerry Java SDK 5.0 and tried all 4 options over WiFi on a few different devices and didn't have any issue.
04-20-2012 02:57 PM - edited 04-20-2012 02:59 PM
Thanks for the code I will give it a try. I will probably post the code of the test app (WebWorks app, simple Ajax connections) I wrote 3 days ago soon.
Side note: We released the latest stable version of our app one year ago (ver 1.5 released MAY 3RD, 2011) and it worked fine till 2 weeks ago. We have a large BB user base, with a lot of new pictures and updates sent from our users on a daily basis. Everything was working fine till April 9th, while right now a lot of users are having issue. ( Eg: http://twitter.com/Mister_Mobility/statuses/193393
The src code that opens network connections was written 3 years ago, and didn't change lately. http://blackberry.trac.wordpress.org/browser/trunk
The question is, why it stopped working suddenly, while the other mobile apps are still working fine? Why the code that was working fine till April 9th is not working anymore only on 1 of my test devices? (All of the devices are attached to the same WiFi network).
04-20-2012 03:27 PM - edited 04-20-2012 03:27 PM
Can you send me the full URL and port you are connecting to? Send over private message if you like.
That will help with the investigation on this side. Thanks!
04-23-2012 10:24 AM
Thank you for sending the test application. I tried it out, but wasn't able to reproduct the TLSIOException when connected over WiFi. I was receiving an EOFException when using HTTPS (HTTP worked fine). This was triggered because the application was not setting the Content-Length header. Once I added that I was able to complete the request. I added to the ContentReaderThread as shown here (middle line).
con.setRequestMethod(HttpConnection.POST);
con.setRequestProperty("Content-Length", Long.toString(documentToSend.length()));
con.setRequestProperty("Content-Type", "text/xml");