Hi all, I'm having an error trying to communicate my j2me app with a php server using https, now the thing is.. It's the first time I ever use https.. So I coud be missing something a bit obvious to many of the programmers around here... So please, Help me out as you can..
This is the important part of the code (I don't wanna paste the whole code to avoid extra lines):
From now on the code is useless since I can't get further than this... I keep getting an error starting the Try block just after getting info on the Certificate (I actually can print the info on the certificate so it finds the server)... then I go to the Catch section... Throwing this:Code://Starts the Try block try { //Https declaration and initialization, as well as certificate information I want to acquire and see... HttpsConnection https = (HttpsConnection) Connector.open(url_base); SecurityInfo si = https.getSecurityInfo(); Certificate c = si.getServerCertificate(); String subject = c.getSubject(); //Setting POST Method and ContentType as well as USer-Agent.. https.setRequestMethod(HttpsConnection.POST); https.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); https.setRequestProperty("User-Agent", "HttpMidlet/0.2"); //Vars for Data and InputStream byte[] data = null; InputStream istrm = null; //Length of Outgoing data https.setRequestProperty("Content-length", "" + content.getBytes().length); //Streaming (OUT) OutputStream out = https.openOutputStream(); . . . . .
I want to point out that I'm using Xampp with a just-created certificate (using xampp's certificate creator), the App connects to my wireless network and tries to access the server via IP, and it does since I can see the certification information from the server on my cel using a custom "output console" on my cel...Code:Exception: "wrong state: 5"
What do you guys think? I'm trying to send simple info between both peers, Client(j2me) and Server (PC - xampp (php) )
Thanks in advance even if you can't help, anything that might ease this for me will be much appreciated,
Armando Leon

Reply With Quote


