1

I have a web site "some.website.com" that is listening to port 80(http) and port 443(https). When I execute following code in CrE-ME™ v4.12 jvm:

HttpConnection conn = (HttpConnection) Connector.open("http://www.example.com/");

My Program works correctly without any issue. When I execute following code in CrE-ME™ v4.12 jvm:

HttpConnection conn = (HttpConnection) Connector.open("https://www.example.com/");

I am getting ConnectionNotFoundException : The requested protocol does not exist

When I execute following code in Java Web Start:

URL url = new URL("http://www.example.com/");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();

or

URL url = new URL("https://www.example.com/");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();

I don't get any problem.

Please help me to solve this https issue in CrE-ME™ v4.12 jvm.

3
  • I have no experience with https, so someone will most likely give a better answer soon. Until then; I'm guessing that JavaME doesn't automatically install the certificate needed for the https connection. Try going to simple-soft.info with the phone browser first to install the certificate (or in some other way make sure that the certificate is installed on the phone), and then try again.
    – mr_lou
    Jun 14, 2014 at 12:09
  • The device that install CrE-ME™ v4.12 jvm is Windows Mobile, and I tried to access the website via Internet Explorer in the device. The IE is able to load https content. Jun 15, 2014 at 8:28
  • Then I'm out of ideas. I'd guess that it's a limitation in CrE-ME then. While waiting for other replies, you could try out another JavaME JVM. Personally I like davy.preuveneers.be/phoneme/?q=node/10 a lot, as I've had great results on Android and an older Windows Mobile device. Have never tried opening a https connection though.
    – mr_lou
    Jun 15, 2014 at 8:52

1 Answer 1

0

The solution of this problem is very simple. Use URL to open connection instead of Connector. Same coding as Java Web Start.

URL url = new URL("https://www.example.com/");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.