CDC and SSL/HTTPS
843849Feb 21 2007 — edited Feb 21 2007I've tried with no luck for a while now to establish a https connection a CDC application. No matter what I do I get various certificate errors.
I managed to get this code working in j2se (urlreader example in cdc-jsse):
HttpConnection c = null;
InputStream is = null;
try {
int len = 0;
int ch = 0;
c = (HttpConnection)Connector.open("https://www.sun.com");
c.setRequestMethod(HttpConnection.GET);
is = c.openInputStream();
}
catch(IOException ex){System.out.println(ex);}
But when I try and re-use it in cdc I just get:
javax.microedition.pki.CertificateException: Certificate was issued by an unrecognized entity
I've tried various code examples but none have worked. All of them gives a certificate error, but as I understand it those certificates (verisign and sun.com) are included in cdc ?
Tried the SSLSocketClient.java example too. Worked fine in j2se but cdc gives med:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
I'm sorry if this is a retarded question but I haven't been able to find any decent documentation on https connections and cdc.
I'm running netbeans5.5+CDC1.0+cdc_jsse1.0.3_03.
Message was edited by:
CeePee