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
Contributor
Posts: 20
Registered: ‎10-11-2010
My Device: Not Specified

talking to .net web service using https

Hi all, I am trying to figure out if it's possible to port a small Android app for Blackberry. My app makes a http get request to .net web service which is configured to work on https with private server certificate. I created a 'private' keystore that contains the server certificate. Then android app could be built to use that keystore to trust the server. I know this is very device-specific and want to know if the similar things are possible on Blackberry. I spent some time to surf the web and found a few similar questions with no answer. Comments, sharing your experience will be appreciated.

Developer
Posts: 16,932
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: talking to .net web service using https

try to put the certificate onto the blackberry before you start development, it should be possible (load it on sd card and use the context menu).
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 20
Registered: ‎10-11-2010
My Device: Not Specified

Re: talking to .net web service using https

Hi Simon, it will be better (for security reason) if the certificate can be contained in the app not in phone's key store so that the cert will be used only by the app. Will it be possible?

Developer
Posts: 16,932
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: talking to .net web service using https

certifcates are public per design. your server keeps its private certificate.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 20
Registered: ‎10-11-2010
My Device: Not Specified

Re: talking to .net web service using https

Simon, about your notion "certifcates are public per design", do you mean that is a Blackberry design? In Android, using OpenSsl and Keytool, I could create a Bouncy Castle keystore that contains the required server certificate, then the app could import the keystore as raw resourse and use it to verify hostname and do https which means that the certificate is used solely by the app. When I use a browser to visit some https site, it would ask "Untrusted...", if I choose to continue, the certificate would be installed into phone's keystore but this is less desirable for my case because the installed certificate can be used by any app on the phone. Can you please clarify?

Developer
Posts: 16,932
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: talking to .net web service using https

ok, i am no specialist in this area so take my posts with a grain of salt.
maybe you can use bouncy castle on the BB as well, saw some posts about it recently.

about the certificates i usually use: the BB gets only the client (public) one, the server has the private certificate. you can use basic auth over https for example to avoid that other apps can use the server with the certificate.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 20
Registered: ‎10-11-2010
My Device: Not Specified

Re: talking to .net web service using https

Thanks Simon, you are correct. Server gives out its public key to client and uses its private key as part of TLS handshaking. My English may not have been clear enough. I used 'private' word to say that the certificate is contained in the keystore that belongs to the app only. I am not clear on this yet, would need to study further.

New Member
Posts: 1
Registered: ‎05-25-2011
My Device: 9700
My Carrier: s

Re: talking to .net web service using https

Hi,

Have you tried using MIDP https connection i dont know if this is what you are looking for i hope it works for you

http://developers.sun.com/mobility/midp/articles/security2/