As @adwiv suggested, take a look at the documentation for HttpConnection and HttpsConnection. As you'll see, an HttpsConnection
is a HttpConnection
(it extends the HttpConnection
interface).
So, it's perfectly acceptable to cast the result of Connector.open("https://abc.com", 3, true)
to an HttpConnection
. There's simply one method in the HttpsConnection
interface that you won't have access to if you cast that way.
Take a look also at these BlackBerry docs for HTTPS connections, complete with sample code.
Regarding the time, it's not uncommon for HTTPS calls to be slower than HTTP calls. Remember, both the client and server side need to encrypt or decrypt the data, and that takes time to do. And, as noted in Peter's comment below, there is initial handshaking that further slows down the transaction.
And, yes, it is secure to use the code as you are. If url
is an HTTPS URL, then you'll be using a secure connection, even if you've cast it to a plain HttpConnection
.