use of org.microemu.cldc.CertificateImpl in project J2ME-Loader by nikita36078.
the class Connection method getSecurityInfo.
@Override
public SecurityInfo getSecurityInfo() throws IOException {
if (securityInfo == null) {
SSLSession session = ((SSLSocket) socket).getSession();
Certificate[] certs = session.getPeerCertificates();
if (certs.length == 0) {
throw new IOException();
}
securityInfo = new SecurityInfoImpl(session.getCipherSuite(), session.getProtocol(), new CertificateImpl((X509Certificate) certs[0]));
}
return securityInfo;
}
use of org.microemu.cldc.CertificateImpl in project J2ME-Loader by nikita36078.
the class Connection method getSecurityInfo.
@Override
public SecurityInfo getSecurityInfo() throws IOException {
if (securityInfo == null) {
if (cn == null) {
throw new IOException();
}
if (!connected) {
cn.connect();
connected = true;
}
HttpsURLConnection https = (HttpsURLConnection) cn;
Certificate[] certs = https.getServerCertificates();
if (certs.length == 0) {
throw new IOException();
}
securityInfo = new SecurityInfoImpl(https.getCipherSuite(), sslContext.getProtocol(), new CertificateImpl((X509Certificate) certs[0]));
}
return securityInfo;
}
Aggregations