• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CertificateException problem, HELP ME!!!

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, sorry for my poor English again...

I have a problem when trying to connect using HttpsConnection. When I connect to the server via browser I have no problem, but when I try to do it from MIDP I get the following Exception:

javax.microedition.pki.CertificateException: Certificate does not contain the correct site name

I'm using the Apache Tomcat Web Server, and I create a certificate keystore by excecuting the following command:

%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA

Then I edit the "server.xml" file as necesary, and the server works fine with SSL.

Then I export the created certificate to a .cer file using my browser, and then import this file from the J2ME Certificate Manager. Otherwise I get this exception:

javax.microedition.pki.CertificateException: Certificate was issued by an unrecognized entity

But now I don't know what to do with the first exception. I read that in some cases I'll have to enter the domain of my website in the field "CN" of the Certificate, my Web app is running at https://localhost:8443/mobilePreVenta
and I try with:

CN=https://localhost:8443/mobilePreVenta
CN=localhost:8443/mobilePreVenta
CN=https://127.0.0.1:8443/mobilePreVenta

and many others like those but It doesn't works.

PLEASE HELP ME !

Thanks in advance.
 
Elías Turbay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the answer to my problem ...

CN=localhost

That's all
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Elias.

I'm trying to do something similar and I'm also finding several difficulties importing certificates in JME Certificate manager. I have a test certificate created by VeriSign configured in my IIS and working perfectly from my web browser. But, when i try to connect from a Midlet it keeps telling me "the certificate was issued by an unrecognized entity".

As long as I know, the only thing I have to do is just import the certificate into the Certificate manager, but It doesn't work. Moreover, if I connect to other secured websites (bank websites for instance) everyhting works fine.

I'm stucked and any help will be very appreciated.

Thanks in advance.
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic