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
Developer
shahumang8
Posts: 575
Registered: ‎08-09-2010
Accepted Solution

TLS Connection implementations Problem

Hi,

 

    How to establish or Implemented TLS Connection with Post and Get method?

 

    There are any option for SetRequestProperty  into TLS?

 

    How to get RequestCode into TLS?

 

Thanks.

Umang.

Please use plain text.
Regular Contributor
milan555
Posts: 52
Registered: ‎07-04-2011
My Carrier: Developer

Re: TLS Connection implementations Problem

Hi,

 

Can you tell me for which purpose you  use TLS connection ?

 

Regards,

 

Please use plain text.
Developer
shahumang8
Posts: 575
Registered: ‎08-09-2010

Re: TLS Connection implementations Problem

Hello,

 

               I need for some security purpose so you can know about it then provide me some example or some tips.

 

Thanks.

Please use plain text.
Regular Contributor
milan555
Posts: 52
Registered: ‎07-04-2011
My Carrier: Developer

Re: TLS Connection implementations Problem

Ok.

For security purpose means ?

You were calling any web service or what ?

If you told your proper idea that what you want to do then I can try to help you.

 

Regards

Please use plain text.
Developer
shahumang8
Posts: 575
Registered: ‎08-09-2010

Re: TLS Connection implementations Problem

Hi,

 

     I need to call webservices and they are requirement of App.

 

 

Thanks.

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

Re: TLS Connection implementations Problem

[ Edited ]

Going by this, and your other post on this Thread:

http://supportforums.blackberry.com/t5/Java-Development/How-to-open-a-secure-TLS-connection-on-Black...

I think you are confused about what is going on here.

 

I'm not an expert, but as I understand it, the various TCP/IP protocols are layered. 

 

At the bottom is the socket connection, which if course you can open using a URL that starts

socket:\\

Now if the other end of your communication is a socket server, this is what you need. 

(Actually I say socket connections are at the bottom, conveniently forgetting UDP connections.  In fact I think a socket connection is built on top of a UDP connection, but we can ignore this for this discussion)

 

Above that is http:\\.  And if you open an HTTP connection, you will open it with an HTTP server.  But an HTTP connection is actually a socket connection with some helpful methods.  You could actually open a socket connection to a HTTP server and as long as you send the right things on the socket and understand what the HTTP server is sending back to you, then you could communicate quite happily.  A while ago, I think I did this in one application where I needed to send a request header that I couldn't generate any other way. 

 

The trouble with both these approaches is that the data is sent insecurely. So to provide securely, the appropriate internet bodies decided to invent a secure socket layer - SSL - as the secure form of socket, and HTTPS which was the secure form of HTTP and would be transmitted over SSL.  So if you opened a connection with HTTPS, instead of creating a socket connection to the HTTP server, the processing will create a secure socket (SSL) connection. 

 

And then they decided SSL could be improved and created TSL. 

 

But you don't actually care.  All you do is open an https:\\ connection to the appropriate server and it will sort out the correct secure socket layer protocol.  If you want to find out what is actually being used, you can - see the

getSecurityInfo()

of your HTTPS connection.

 

So if you need to call a web service that is secure, then just use https:\\ and the correct port (usually 443) and the rest will take care of itself. 

 

Does this clarify the problem?

Please use plain text.
Developer
shahumang8
Posts: 575
Registered: ‎08-09-2010

Re: TLS Connection implementations Problem

Hi Peter,

 

 Thanks for reply me.

 

 But actully i need below infomation 

 

 -> Into Https we call webserivce into GET and POST.And also set some methode like setReqeustProperty and SetRequestMethod.

 

  So into TLS how to do?

 

Thanks,

Umang.

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

Re: TLS Connection implementations Problem

As noted, not an area of expertise, but this is what I understand.  You don't use TLS.  You use HTTPS.  The Web Server implements this with TLS..

 

So you do an HTTPS connection to the Web Server.  Under the covers, it will use the TLS socket level security.  But because you have established an HTTPS Connection, which is like an HTTP Connection, you use the HTTP GET and POST methods, and you can setRequestProperty.

Please use plain text.
Developer
shahumang8
Posts: 575
Registered: ‎08-09-2010

Re: TLS Connection implementations Problem

Hi Peter,

 

     Please check attachement.

 

     There are difference to pass parameter into Https and TLS.But there are not mention that how to setRequestProperty and method into TLS.

 

 

Thanks,

Umang.

 

     

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

Re: TLS Connection implementations Problem

I'm sorry, you are asking the same question a different way - it appears I am not able to explain this to you. 

 

Possibly this is because in fact I am wrong in what I think - as I keep noting, this is not an area of expertise.  But what I am telling you is what I believe to be correct and I have researched this. 

 

The code sample provided by Mark Sohm, does NOT use HTTPS.  It provides 3 different socket level connections.  None of the connections support setRequestProperty(). 

 

HTTPS and HTTP are protocols that exist on top of socket level connections.  They support setRequestMethod. 

 

You seem to have the idea stuck in your head that you should be able do a use the setRequestMethod() on a TLS Connection.  You can't.  You can only do this to a connection established using the HTTP or HTTPS protocol.

 

Since you seem to be stuck at this point, I suggest a different starting point.  Go back to the people providing the Web Service you are trying to use and ask how other users are using this service.  Are they establishing HTTPS connections?  Is this Web Service a socket or HTTP server?

Please use plain text.