HTTPS depends on certificate negotiation. It could be that the emulator isn't successful at authorizing the certificate it recieves from the HTTPS site. --(I know my web browser certainly complains with security error prompts when I visit https website addresses that mistakenly send a certificate for their unsecure, regular http domain name address.)
There is an exception you can catch: javax.microedition.pki.CertificateException which is a subclass of IOException. You might really be catching a CertificateException rather than an IOException, and CertificateException can tell you more about what's going wrong.
Walter Gabrielsen Iii wrote:HTTPS depends on certificate negotiation. It could be that the emulator isn't successful at authorizing the certificate it recieves from the HTTPS site. --(I know my web browser certainly complains with security error prompts when I visit https website addresses that mistakenly send a certificate for their unsecure, regular http domain name address.)
There is an exception you can catch: javax.microedition.pki.CertificateException which is a subclass of IOException. You might really be catching a CertificateException rather than an IOException, and CertificateException can tell you more about what's going wrong.
Thanks for reply.
Nope. It is not CertificateException - i've tested on another server with wrong certificate and saw CertificateException, but in my case it is definitely IOException.
Little clarifications:
1) this exception i get not on Connector.open(url) but on connection.openInputStream()
2) seems to on some https-servers it works fine without any exception. Still don't understand why it doesnt like my server
3) just in case i tried to import server certificate to wtk - not helps
4) application works correctly with my https-server on Symbian3 SDK Emulator
I tracked down a website that documents com.sun.midp.ssl.Record from your error stack trace, above.
So, from your error message, your program is calling rdRec(), to read a value, where something is going wrong, and then it calls Alert(2,40). In other words, Fatal (2) Handshake failure alert type (40).
Perhaps, print out the exception message, getMessage(), and see what it says.
Walter Gabrielsen Iii wrote:I have some questions:
1. Are you using the Java ME 3.0 SDK along with Java SE 6 or 7, which?
2. Have you added API Permissions properties?
Projects window (right-click your project)>> Properties (from menu):
Application Descriptor >> API Permissions
Add:
javax.microedition.io.Connector.https
3. Do you have an example of code where the error is happening?
4. Could it be that your Operating System's firewall is blocking the SDK application or Java?
1. Java SE 6
2. javax.microedition.io.Connector.https exists in jad/manifest
3. Code is very simple and common, there is nothing special
4. I think no because it works fine with some https-servers.
But.. I dont have time to fight with this issue - i wrote simple http->https proxy and use it.
IAC thank for your help!