This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

CertificateException problem, HELP ME!!!

 
Elías Turbay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I found the answer to my problem ...

CN=localhost

That's all
 
Jos� M. Crist�bal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!