Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTPS / MIDP 1.0

 
Greg Schwartz
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt whether iDen and WTK's MIDP 1.0 emulators support HTTPS.
 
Ould Nadif
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

HTTPS is available since MIDP1.04 .
Try the version of MIDP you use.

OULD NADIF
 
Greg Schwartz
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been using the new MIDP 2.0 iDEN SDK and Sun's latest Wireless Toolkit. In both casese, I tried building as a MIDP 2.0 project but still was not successful with the HTTPS connection.

Has anyone successfully connected to an HTTPS URL using an HTTPConnection within one of these toolkits?
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In MIDP 2, the HTTPS connection is represented by the HttpsConnection class in the GCF. You cannot treat it like a HttpConnection any more.
 
Greg Schwartz
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greg Schwartz
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic