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
BlackBerry Development Advisor
Posts: 15,055
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

SSL Connection falls with EOFException

Quote from the previous forum:


LtSolo

Posts: 7
Registered: Jun, 2008

SSL Connection falls with EOFException
Posted: Jul 31, 2008 7:42 AM
 
Hello,

I'm having problems with SLL connection. What I tried is very simple connection establish code:
public static void main(String[] args)
{
try {
Connection cc = javax.microedition.io.Connector.open("ssl://pbxtr a.axmor.nsk:5222;deviceside=false;EndToEndRequired ");

} catch(Exception e) {
System.out.println(e.toString());
}
}

On javax.microedition.io.Connector.open the code throws EOFException. I believe that the code should be a bit more complicated. Please advice on this.


 

Cast the connection returned to a SecureConnection and try opening your InputStream and OutputStream from there.  If you continue to have problems please provide the BlackBerry model and handhed software version you are testing on.  You can find this under Options, About on the BlackBerry.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 36
Registered: ‎08-04-2008
My Device: Curve 9000

Re: SSL Connection falls with EOFException

Hello,

 

thanks for your reply. I tried to cast return object to this type or even dont cast at all:

public static void main(String[] args) { try { /*Connection cc =*/ javax.microedition.io.Connector.open("ssl://pbxtr a.axmor.nsk:5222;deviceside=false;EndToEndRequired "); } catch(Exception e) { System.out.println(e.toString()); } }

 

But this also throws the exception. I tried this on the emulator that comes with JDE 4.3.0 with MDS running at the same time.

Andrey Zharkikh
Project Manager, Axmor Software
New Developer
Posts: 36
Registered: ‎08-04-2008
My Device: Curve 9000

Re: SSL Connection falls with EOFException

I found the cause of the problem! An SSL certificate we are using on the server is not trusted (valid and not expired, but not trusted). Surely we'll resolve this issue shortly on our testing server.

 

   Please let me know if this is possible to bypass not trusted certificates. This is not great to ask end users to have trusted certificates. On some platforms (like Windows Mobile) there are ways to allow specific or all certificates from the code. I know that in J2ME this is not possible. What about Blackberry?

Andrey Zharkikh
Project Manager, Axmor Software
BlackBerry Development Advisor
Posts: 15,055
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: SSL Connection falls with EOFException

You can use the Certificate Sync feature of Desktop Manater to load your certificate on a BlackBerry.  The user can then trust it and your application can use it for its connection.

 

Please note that this feature is not installed by default so you'll need to perform an advanced installation and select it.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker