02-11-2010 11:13 AM
I would appreciate any help on this.
Since OS 4.2.1 I have been using SSL30Connection to establish SSL sessions over a SocketConnection in many devices and OS versions without problems.
Recently I updated my BlackBerry Storm 9530 to OS 220.127.116.119 (platform 18.104.22.168) and started getting a NullPointerException with the same code that used to work just fine in other OS versions.
I also tried running this application on the BlackBerry 9550 simulator (OS 22.214.171.1244), but got the same issue.
The specific piece of code that triggers the error is pretty simple:
public void run()
conn = new SSL30Connection(socket, host + ":" + port, true);
is = conn.openInputStream();
os = conn.openOutputStream();
info = conn.getSecurityInfo();
cert = info.getServerCertificate();
catch (IOException ex)
Here is the stack trace I am getting:
Name: NullPointerException GUID: 9c3cd62e3320b498 Time: Feb 11, 2010 16:05:33 No detail message net_rim_cldc(4AE1FC51) Hashtable get 0x58A5 net_rim_crypto_2-3(4AE207FA) SSLHandshakeProtocol <private> 0x2A40 net_rim_crypto_2-3(4AE207FA) SSLHandshakeProtocol serverCertificate 0x5E8 net_rim_crypto_2-3(4AE207FA) SSLHandshakeProtocol connect 0x1B34 net_rim_crypto_2-3(4AE207FA) SSLRecordProtocol connect 0x338D net_rim_crypto_2-2(4AE207FA) SSL30Connection <init> 0x1552 TotalCross-2(4B74294F) SSL$1 run 0x4BD1
Solved! Go to Solution.
02-11-2010 11:54 AM - edited 02-11-2010 11:56 AM
This is a known issue in v126.96.36.199+ handheld software. See RIM Jira issue #JAVAAPI-327 (https://www.blackberry.com/jira/browse/JAVAAPI-327). Although that issue is about TLS10Connection throwing a NullPointereException, I suspect the root cause is exactly the same and fixing JAVAAPI-327 will fix your issue too. Nevertheless, it may be a good idea to open another ticket in RIM Jira with your issue (potentially referencing JAVAPI-327) -- RIM can merge the two if they are the same.
02-11-2010 02:07 PM
Thank you very much for your answer. In fact, this seems exactly the same issue you described. Anyway, I updated issue #JAVAAPI-327 with this new info.
02-11-2010 02:12 PM - edited 02-11-2010 02:12 PM
It's a pity RIM didn't fix this issue back in August 2009 when it was reported and when they could've ensured that all official v5.0 handheld software is free of this bug. Now we have to live with most v5.0 handhelds having this issue.
02-24-2010 11:50 AM
Great news: we now have a work around for this issue (taken from https://www.blackberry.com/jira/browse/JAVAAPI-327)
Tim Windsor added a comment - 24/Feb/10 10:04 AM - edited
"A work around for this issue is to use the full connection string when opening the TLS10Connection, or SSL30Connection. For example, the attached test app does this:
conn = (StreamConnection)Connector.open("socket://www.google.com:443;deviceside=true;interface=wifi"); log("Wrapping socket connection into TLS10Connection"); final TLS10Connection tlsConn = new TLS10Connection(conn, "www.google.com");
And it should do this:
conn = (StreamConnection) Connector.open("socket://www.google.com:443;deviceside=true;interface=wifi"); log("Wrapping socket connection into TLS10Connection"); final TLS10Connection tlsConn = new TLS10Connection(conn, "socket://www.google.com:443;deviceside=true;interface=wifi");
When this issue has been resolved, the domain name can be used again."