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
New Developer
bcbas
Posts: 6
Registered: ‎02-05-2009
My Device: Not Specified
Accepted Solution

NullPointerException creating an SSL30Connection (OS 5.0.0.419)

Hello,

 

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 5.0.0.419 (platform 4.2.0.179) 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 5.0.0.334), but got the same issue.

 

The specific piece of code that triggers the error is pretty simple:

 

public void run()
{
try
   {
   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

 

 

Any thoughts?


Thanks,

 

Bruno.

 

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: NullPointerException creating an SSL30Connection (OS 5.0.0.419)

[ Edited ]

This is a known issue in v5.0.0.190+ 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.

New Developer
bcbas
Posts: 6
Registered: ‎02-05-2009
My Device: Not Specified

Re: NullPointerException creating an SSL30Connection (OS 5.0.0.419)

klyubin,

 

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.

 

Regards,

 

Bruno.

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: NullPointerException creating an SSL30Connection (OS 5.0.0.419)

[ Edited ]

You're welcome!

 

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.

New Developer
bcbas
Posts: 6
Registered: ‎02-05-2009
My Device: Not Specified

Re: NullPointerException creating an SSL30Connection (OS 5.0.0.419)

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."