Search in sources :

Example 1 with SSLFDProxy

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;
}
Also used : SSLFDProxy(org.mozilla.jss.nss.SSLFDProxy)

Example 2 with SSLFDProxy

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;
}
Also used : SSLFDProxy(org.mozilla.jss.nss.SSLFDProxy)

Example 3 with SSLFDProxy

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);
}
Also used : PRFDProxy(org.mozilla.jss.nss.PRFDProxy) SSLFDProxy(org.mozilla.jss.nss.SSLFDProxy)

Example 4 with SSLFDProxy

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);
}
Also used : PRFDProxy(org.mozilla.jss.nss.PRFDProxy) SSLFDProxy(org.mozilla.jss.nss.SSLFDProxy) SecurityStatusResult(org.mozilla.jss.nss.SecurityStatusResult)

Example 5 with SSLFDProxy

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);
}
Also used : PRFDProxy(org.mozilla.jss.nss.PRFDProxy) SSLFDProxy(org.mozilla.jss.nss.SSLFDProxy) SSLChannelInfo(org.mozilla.jss.nss.SSLChannelInfo)

Aggregations

SSLFDProxy (org.mozilla.jss.nss.SSLFDProxy)13 PRFDProxy (org.mozilla.jss.nss.PRFDProxy)11 SSLException (javax.net.ssl.SSLException)1 CryptoManager (org.mozilla.jss.CryptoManager)1 BufferProxy (org.mozilla.jss.nss.BufferProxy)1 SSLChannelInfo (org.mozilla.jss.nss.SSLChannelInfo)1 SSLPreliminaryChannelInfo (org.mozilla.jss.nss.SSLPreliminaryChannelInfo)1 SecurityStatusResult (org.mozilla.jss.nss.SecurityStatusResult)1 PK11Cert (org.mozilla.jss.pkcs11.PK11Cert)1 PK11PrivKey (org.mozilla.jss.pkcs11.PK11PrivKey)1 SSLAlertEvent (org.mozilla.jss.ssl.SSLAlertEvent)1