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.