I am having a problem trying to get HTTPS to work within my MIDP 1.0 application. I am using the following code included below. The HTTPS site works fine from a browser and has a certificate so there is no security message when visiting the site. I have been using the new iDEN and Sun emulators, both of which support HTTPS. When I switch to an HTTP URL, the code works fine. According to Knudsen's book, if the handset/network support HTTPS you should be able to use an HTTPS URL within an HttpConnection object. If anyone knows what the problem might be, please let me know. Thanks in advance.
To make sure I understand this correctly...If we build a MIDP 1.0 client (i.e. using a MIDP 1.0 SDK and MIDP 1.0 architecture) and run this application on a MIDP 2.0 handset, would we have to use HTTPSConnection or could we use an HTTPConnection with an HTTPS URL?
I am asking because I would like to have the same code work on MIDP 1.0 and MIDP 2.0 handsets. If we went with the HTTPSConnection in our code, this would not be compatible with MIDP 1.0 phones.
Hmm, since HttpsConnection inherit from HttpConnection, you should be able to use the "https://" connection string and get a HttpConnection object back -- just as on MIDP 1 devices. What is the error message you are getting? I know that on Nokia devices, they have requirements on what kind of certificates they can accept. Basically, the site has to have a valid cert signed by verisign or thawte.
I just tested this on a MIDP 2.0 handsets (Motorola i830) and was not successful. I am not able to connect to an HTTPS URL with a valid cert using an HTTPConnection object within a MIDP 1.0 application. There is no error message returned and when I use network monitor in the WTK, the monitor shows no network activity.
posted 14 years ago
On your Motorola i830, if you try to access that HTTPS url from the native web browser, what happens? [ June 14, 2004: Message edited by: Michael Yuan ]