Package javax.net.ssl

Examples of javax.net.ssl.HandshakeCompletedEvent


    protected Object[] getData() {
        try {
            SSLContext cont = SSLContext.getInstance("TLS");
            cont.init(null, null, null);
            SSLSocket soc = (SSLSocket )cont.getSocketFactory().createSocket();
            return new Object[] { new HandshakeCompletedEvent(soc, soc.getSession())};
        } catch (Exception e) {
            fail("Can not create data: "+ e);
            return null;
        }
       
View Full Code Here


        }
       
    }

    public void assertDeserialized(Serializable oref, Serializable otest) {
        HandshakeCompletedEvent test = (HandshakeCompletedEvent) otest;
        test.getSession();
        test.getSocket();
    }
View Full Code Here

        if (noFreePort || noSocket) {
            return;
        }
        SSLSession ses = new MySSLSession();

        HandshakeCompletedEvent event = new HandshakeCompletedEvent(soc, ses);
       
        assertEquals(event.getCipherSuite(), ses.getCipherSuite());
    }
View Full Code Here

    public final void testGetLocalCertificates() {
      if (noFreePort || noSocket) {
            return;
        }
      SSLSession ses = new MySSLSession();
        HandshakeCompletedEvent event = new HandshakeCompletedEvent(soc, ses);

        Certificate[] certs = event.getLocalCertificates();
        Certificate[] ses_certs = ses.getLocalCertificates();
        if (certs == null && ses_certs == null) {
            return;
        }
        if (certs == null || ses_certs == null) {
View Full Code Here

    public final void testGetPeerCertificates() {
      if (noFreePort || noSocket) {
            return;
        }
      SSLSession ses = new MySSLSession();
        HandshakeCompletedEvent event = new HandshakeCompletedEvent(soc, ses);
        try {
            event.getPeerCertificates();
            fail("No excpected SSLPeerUnverifiedException");
        } catch (SSLPeerUnverifiedException e) {
        }
    }
View Full Code Here

    public final void testGetPeerCertificateChain() {
      if (noFreePort || noSocket) {
            return;
        }
      SSLSession ses = new MySSLSession();
        HandshakeCompletedEvent event = new HandshakeCompletedEvent(soc, ses);
        try {
            event.getPeerCertificateChain();
            fail("No excpected SSLPeerUnverifiedException");
        } catch (SSLPeerUnverifiedException e) {
        }
    }
View Full Code Here

        if (noFreePort || noSocket) {
            return;
        }
        SSLSession ses = new MySSLSession();

        HandshakeCompletedEvent event = new HandshakeCompletedEvent(soc, ses);
        String name = event.getCipherSuite();
        String name_ses = ses.getCipherSuite();
        if (name == null && name_ses != null) {
            fail("incorrect null CipherCuite");
        }
        if (!name.equals(name_ses)) {
View Full Code Here

    public final void testGetLocalCertificates() {
      if (noFreePort || noSocket) {
            return;
        }
      SSLSession ses = new MySSLSession();
        HandshakeCompletedEvent event = new HandshakeCompletedEvent(soc, ses);

        Certificate[] certs = event.getLocalCertificates();
        Certificate[] ses_certs = ses.getLocalCertificates();
        if (certs == null && ses_certs == null) {
            return;
        }
        if (certs == null || ses_certs == null) {
View Full Code Here

    public final void testGetPeerCertificates() {
      if (noFreePort || noSocket) {
            return;
        }
      SSLSession ses = new MySSLSession();
        HandshakeCompletedEvent event = new HandshakeCompletedEvent(soc, ses);
        try {
            event.getPeerCertificates();
            fail("No excpected SSLPeerUnverifiedException");
        } catch (SSLPeerUnverifiedException e) {
        }
    }
View Full Code Here

    public final void testGetPeerCertificateChain() {
      if (noFreePort || noSocket) {
            return;
        }
      SSLSession ses = new MySSLSession();
        HandshakeCompletedEvent event = new HandshakeCompletedEvent(soc, ses);
        try {
            event.getPeerCertificateChain();
            fail("No excpected SSLPeerUnverifiedException");
        } catch (SSLPeerUnverifiedException e) {
        }
    }
View Full Code Here

TOP

Related Classes of javax.net.ssl.HandshakeCompletedEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.