use of org.mozilla.jss.nss.SSLFDProxy in project jss by dogtagpki.
the class TestBufferPRFD method Setup_NSS_Client.
public static SSLFDProxy Setup_NSS_Client(PRFDProxy fd, String host) throws Exception {
SSLFDProxy result = SSL.ImportFD(null, fd);
assert (result != null);
assert (SSL.ResetHandshake(result, false) == SSL.SECSuccess);
assert (SSL.SetURL(result, host) == SSL.SECSuccess);
TestSSLVersionGetSet(result);
return result;
}
use of org.mozilla.jss.nss.SSLFDProxy in project jss by dogtagpki.
the class TestBufferPRFD method Setup_NSS_Server.
public static SSLFDProxy Setup_NSS_Server(PRFDProxy fd, String host, PK11Cert cert, PK11PrivKey key) throws Exception {
SSLFDProxy result = SSL.ImportFD(null, fd);
assert (result != null);
assert (SSL.ConfigServerCert(result, cert, key) == SSL.SECSuccess);
assert (SSL.ConfigServerSessionIDCache(1, 100, 100, null) == SSL.SECSuccess);
assert (SSL.ResetHandshake(result, true) == SSL.SECSuccess);
assert (SSL.SetURL(result, host) == SSL.SECSuccess);
TestSSLVersionGetSet(result);
return result;
}
use of org.mozilla.jss.nss.SSLFDProxy in project jss by dogtagpki.
the class TestRawSSL method TestSSLImportFD.
public static void TestSSLImportFD() throws Exception {
PRFDProxy fd = PR.NewTCPSocket();
assert (fd != null);
SSLFDProxy ssl_fd = SSL.ImportFD(null, fd);
assert (ssl_fd != null);
assert (PR.Close(ssl_fd) == PR.SUCCESS);
}
use of org.mozilla.jss.nss.SSLFDProxy in project jss by dogtagpki.
the class TestRawSSL method TestSSLSecurityStatus.
public static void TestSSLSecurityStatus() throws Exception {
PRFDProxy fd = PR.NewTCPSocket();
assert (fd != null);
SSLFDProxy ssl_fd = SSL.ImportFD(null, fd);
assert (ssl_fd != null);
SecurityStatusResult r = SSL.SecurityStatus(ssl_fd);
assert (r != null);
assert (r.on == 0);
// Validate toString works
System.out.println(r.toString());
assert (PR.Close(ssl_fd) == PR.SUCCESS);
}
use of org.mozilla.jss.nss.SSLFDProxy in project jss by dogtagpki.
the class TestRawSSL method TestSSLGetChannelInfo.
public static void TestSSLGetChannelInfo() throws Exception {
PRFDProxy fd = PR.NewTCPSocket();
assert (fd != null);
SSLFDProxy ssl_fd = SSL.ImportFD(null, fd);
assert (ssl_fd != null);
SSLChannelInfo r = SSL.GetChannelInfo(ssl_fd);
assert (r != null);
assert (r.getProtocolVersion() == null);
System.out.println(r.toString());
assert (PR.Close(ssl_fd) == PR.SUCCESS);
}
Aggregations