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
Posts: 6
Registered: ‎05-21-2009
My Device: Not Specified

Https connection issue

Hi,

 

I have following issue:

 

I'm connecting to https url and  I have 2 cases:

1) when I connect to server with trusted certificate (i.e https://www.google.com ) I get proper response

2) when I connect to server with untrusted certificate I get  "You are attempting to open a secure connection, but  the server's certificate is not trusted" message . I would rather get Exception, and handle it, so question is: Is there opportunity to force HttpsConnection to throw exception instead showing popup?

 

Cheers,

 

Maciej

Developer
Posts: 75
Registered: ‎07-21-2009
My Device: Not Specified

Re: Https connection issue

hi,

     Just search the NetworkDiagnostic tool it is available on blackberry side.install it on your device and check which way your handset support the request.

 

 

Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Https connection issue

you can find the network tool here

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

Thanks and Regards,
PraveenGoparaju.
Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Https connection issue

I'm not aware of a way to achieve this programmatically. However, I believe you can require only verified chains of trust using the settings under Options -> Security Options -> TLS or using the IT Policy.

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

Re: Https connection issue

Hi,

 

Thanks for your reply.

 

But I have a different problem. I can connect using the https url, but in case of  untrusted destination server I get popup in my app asking user: "You are attempting to open a secure connection, but the server's certificate is not trusted : Continue/Close connection/ View certification/ Trust certificate ". I want to deny user to use an untrusted servers, so I  would like to turn off the popup that asks user. User should only use the trusted https url and nothing else.

 

Cheers,

Maciek

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

Re: Https connection issue

As I mentioned earlier, you can tell the OS (albeit not programmatically, as far as I know) to deny TLS/SSL connections where the chain of trust of the server certificate cannot be verified.

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

Re: Https connection issue

Thanks a lot.

 

But I have to do it programmatically... . Is there any way to do that? Maybe I can handle the showing popup event and then use event injector?

 

Cheers,

Maciek

Visitor
Posts: 1
Registered: ‎02-18-2010
My Device: whatever
My Carrier: whatever

Re: Https connection issue

Did you ever resolve this?  We don't care so much about users seeing the popup warning, but we do want to be able to check to see whether the certificate is signed by a trusted CA.  If it is not, we need to be able to exit gracefully.