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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Contributor
kannappan88
Posts: 40
Registered: ‎10-10-2011
My Carrier: Airtel
Accepted Solution

How to open a secure TLS connection on BlackBerry?

Hi All,

 

I am using a secure connection on BlackBerry. I have a client certificate(.crt).

How to open a secure connection?

How to add the client certificate to server connection code?

How to get certificate from Server?

How to verify the certificate?

 

I am using this code,it throws uncaught exception.

 

SecureConnectionconn = (SecureConnection) Connector
.open("tls://my server address:5061;deviceside=true",Connector.READ_WRITE,true);

 

please help me.ASAP send sample code.

 

Thanks

 

 

Please use plain text.
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
My Carrier: Bell

Re: How to open a secure TLS connection on BlackBerry?

First you'll need to Add a Certificate to DeviceKeyStore.  What exception are you getting (include its .toString details)?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
Contributor
kannappan88
Posts: 40
Registered: ‎10-10-2011
My Carrier: Airtel

Re: How to open a secure TLS connection on BlackBerry?

Hi Mark,

 

I have added the certificate to Device Keystore(ex: ca.crt file) Successfully.I didn't get any exception.

 

I am using this code

SecureConnection conn=(SecureConnection )Connector.open("tls://address:smileytongue:ort;deviceside=true");

 

How to add the certificate to Server conection code?Is it require or not? How to verify the server certificate?

 

 


Please use plain text.
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
My Carrier: Bell

Re: How to open a secure TLS connection on BlackBerry?

What exception does that code give you?

 

I've attached a sample that shows various ways to make a secure connection.  It's set to use WiFi only right now (interface=wifi).

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
Contributor
kilia
Posts: 18
Registered: ‎10-11-2010

Re: How to open a secure TLS connection on BlackBerry?

Hi Mark, 

 

Is there any difference between calling the following with "tls://"

sec = (SecureConnection)Connector.open(_theUrl);
input = sec.openInputStream();
output = sec.openOutputStream();                                

 

and calling the following with "socket://"

s = (StreamConnection)Connector.open(_theUrl);
tls10 = new TLS10Connection(s, _theUrl);
input = tls10.openInputStream();
output = tls10.openOutputStream();
 

 Thanks.

 

Please use plain text.
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
My Carrier: Bell

Re: How to open a secure TLS connection on BlackBerry?

Not really.  The first example (with the tls:// URL) does the same thing in the Connector.open call.

 

Mark

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
Developer
shahumang8
Posts: 461
Registered: ‎08-09-2010

Re: How to open a secure TLS connection on BlackBerry?

Hi,

 

     Can you provide me some idea for how to SetRequestProperty  into TLS?

 

Thanks,

Umang.

Please use plain text.
Developer
peter_strange
Posts: 17,713
Registered: ‎07-14-2008

Re: How to open a secure TLS connection on BlackBerry?

Please use plain text.