I need to talk to a server over a secure socket connection (SSL). Unfortunately, the server that I need to talk to is using a self-issued certificate and so whenever I try to open up a connection to it:
I get a CertificateException with the code UNRECOGNIZED_ISSUER which apparently is because the matching certificate is not on the device's keystore as it is self-issued.
Now what I need to know is how I can import a self-issued certificate into the device's keystore programatically so that when I open up a socket connection via SSL to the server
that uses a self-issued keystore, the network client API will recognize the certificate, the handshake will be complete, and the connection will be opened.
I've looked at the MIDP GCF and it seems to be pretty limited in what it can do. I also tried looking up BouncyCastle as it is one of the popular network library out there and that it supports
J2ME but it is a very confusing API and I can't really figure out where to start on that one.
I have been struggling with this problem for a while and I hope that somebody can help me on this. I'd prefer to not use BouncyCastle as it looks like a lot of API for a simple task that I am trying to
accomplish but if this is the only choice, a simple snippet on how to do it would be really helpful!