This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

HTTPS / MIDP 1.0

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
author
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I doubt whether iDen and WTK's MIDP 1.0 emulators support HTTPS.
 
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic