Lines Matching refs:ssl
16 package tests.api.javax.net.ssl;
24 import javax.net.ssl.*;
39 import tests.api.javax.net.ssl.HandshakeCompletedEventTest.TestTrustManager;
54 * @tests javax.net.ssl.SSLSocket#SSLSocket()
64 SSLSocket ssl = getSSLSocket();
73 * @tests javax.net.ssl.SSLSocket#SSLSocket(InetAddress address, int port)
82 SSLSocket ssl;
86 ssl = getSSLSocket(InetAddress.getLocalHost(), sport);
87 assertNotNull(ssl);
88 assertEquals(sport, ssl.getPort());
91 ssl = getSSLSocket(InetAddress.getLocalHost(), sport + 1);
99 ssl = getSSLSocket(InetAddress.getLocalHost(), invalidPort[i]);
112 * @tests javax.net.ssl.SSLSocket#SSLSocket(InetAddress address, int port,
122 SSLSocket ssl;
126 ssl = getSSLSocket(InetAddress.getLocalHost(), sport,
128 assertNotNull(ssl);
129 assertEquals(sport, ssl.getPort());
130 assertEquals(portNumber, ssl.getLocalPort());
133 ssl = getSSLSocket(InetAddress.getLocalHost(), 8081, InetAddress.getLocalHost(), 8082);
140 ssl = getSSLSocket(InetAddress.getLocalHost(), -1,
149 ssl = getSSLSocket(InetAddress.getLocalHost(), sport,
159 ssl = getSSLSocket(InetAddress.getLocalHost(), Integer.MIN_VALUE,
171 ssl = getSSLSocket(InetAddress.getLocalHost(), sport,
183 ssl = getSSLSocket(InetAddress.getLocalHost(), 65536,
194 ssl = getSSLSocket(InetAddress.getLocalHost(), sport,
204 ssl = getSSLSocket(InetAddress.getLocalHost(), Integer.MAX_VALUE,
216 ssl = getSSLSocket(InetAddress.getLocalHost(), sport,
231 * @tests javax.net.ssl.SSLSocket#SSLSocket(String host, int port)
240 SSLSocket ssl;
244 ssl = getSSLSocket(InetAddress.getLocalHost().getHostName(), sport);
245 assertNotNull(ssl);
246 assertEquals(sport, ssl.getPort());
249 ssl = getSSLSocket("localhost", 8082);
257 ssl = getSSLSocket(InetAddress.getLocalHost().getHostName(), invalidPort[i]);
267 ssl = getSSLSocket("bla-bla", sport);
279 * @tests javax.net.ssl.SSLSocket#SSLSocket(String host, int port, InetAddress clientAddress,
289 SSLSocket ssl;
294 ssl = getSSLSocket(InetAddress.getLocalHost().getHostName(), sport,
296 assertNotNull(ssl);
297 assertEquals(sport, ssl.getPort());
298 assertEquals(portNumber, ssl.getLocalPort());
301 ssl = getSSLSocket("localhost", 8081, InetAddress.getLocalHost(), 8082);
310 ssl = getSSLSocket(InetAddress.getLocalHost().getHostName(), invalidPort[i],
319 ssl = getSSLSocket(InetAddress.getLocalHost().getHostName(), sport,
331 ssl = getSSLSocket("bla-bla", sport, InetAddress.getLocalHost(), portNumber);
363 * @tests javax.net.ssl.SSLSocket#addHandshakeCompletedListener(HandshakeCompletedListener listener)
369 args = {javax.net.ssl.HandshakeCompletedListener.class}
373 SSLSocket ssl = getSSLSocket();
376 ssl.addHandshakeCompletedListener(null);
382 ssl.addHandshakeCompletedListener(ls);
390 * @tests javax.net.ssl.SSLSocket#removeHandshakeCompletedListener(HandshakeCompletedListener listener)
396 args = {javax.net.ssl.HandshakeCompletedListener.class}
399 SSLSocket ssl = getSSLSocket();
402 ssl.removeHandshakeCompletedListener(null);
409 ssl.removeHandshakeCompletedListener(ls);
416 ssl.addHandshakeCompletedListener(ls);
418 ssl.removeHandshakeCompletedListener(ls);
426 * @tests javax.net.ssl.SSLSocket#setEnableSessionCreation(boolean flag)
427 * @tests javax.net.ssl.SSLSocket#getEnableSessionCreation()
444 SSLSocket ssl = getSSLSocket();
445 assertTrue(ssl
446 ssl.setEnableSessionCreation(false);
447 assertFalse(ssl.getEnableSessionCreation());
448 ssl.setEnableSessionCreation(true);
449 assertTrue(ssl.getEnableSessionCreation());
455 * @tests javax.net.ssl.SSLSocket#setNeedClientAuth(boolean need)
456 * @tests javax.net.ssl.SSLSocket#getNeedClientAuthCreation()
473 SSLSocket ssl = getSSLSocket();
474 ssl.setNeedClientAuth(true);
475 assertTrue(ssl.getNeedClientAuth());
476 ssl.setNeedClientAuth(false);
477 assertFalse(ssl.getNeedClientAuth());
483 * @tests javax.net.ssl.SSLSocket#setWantClientAuth(boolean want)
484 * @tests javax.net.ssl.SSLSocket#getWantClientAuthCreation()
501 SSLSocket ssl = getSSLSocket();
502 ssl.setWantClientAuth(true);
503 assertTrue(ssl.getWantClientAuth());
504 ssl.setWantClientAuth(false);
505 assertFalse(ssl.getWantClientAuth());
510 * @tests javax.net.ssl.SSLSocket#getSupportedProtocols()
519 SSLSocket ssl = getSSLSocket();
520 String[] res = ssl.getSupportedProtocols();
526 * @tests javax.net.ssl.SSLSocket#getEnabledProtocols()
527 * @tests javax.net.ssl.SSLSocket#setEnabledProtocols(String[] protocols)
544 SSLSocket ssl = getSSLSocket();
546 ssl.setEnabledProtocols(null);
551 ssl.setEnabledProtocols(new String[] {});
556 ssl.setEnabledProtocols(new String[] {"blubb"});
560 ssl.setEnabledProtocols(ssl.getEnabledProtocols());
561 String[] res = ssl.getEnabledProtocols();
563 ssl.getEnabledProtocols().length, res.length);
568 * @tests javax.net.ssl.SSLSocket#getSession()
577 SSLSocket ssl = getSSLSocket();
579 assertNotNull(ssl.getSession());
587 * @tests javax.net.ssl.SSLSocket#getSupportedCipherSuites()
596 SSLSocket ssl = getSSLSocket();
597 String[] res = ssl.getSupportedCipherSuites();
603 * @tests javax.net.ssl.SSLSocket#getEnabledCipherSuites()
604 * @tests javax.net.ssl.SSLSocket#setEnabledCipherSuites(String[] suites)
621 SSLSocket ssl = getSSLSocket();
623 ssl.setEnabledCipherSuites(null);
628 ssl.setEnabledCipherSuites(new String[] {});
633 ssl.setEnabledCipherSuites(new String[] {"blubb"});
637 ssl.setEnabledCipherSuites(ssl.getSupportedCipherSuites());
638 String[] res = ssl.getEnabledCipherSuites();
641 Arrays.asList(ssl.getSupportedCipherSuites()),
647 * @tests javax.net.ssl.SSLSocket#getUseClientMode()
648 * @tests javax.net.ssl.SSLSocket#setUseClientMode(boolean mode)
665 SSLSocket ssl = getSSLSocket();
666 assertTrue(ssl.getUseClientMode());
667 ssl.setUseClientMode(false);
668 assertFalse(ssl.getUseClientMode());
670 ssl = getSSLSocket("localhost", startServer("UseClientMode"));
672 ssl.startHandshake();
677 ssl.setUseClientMode(false);
688 * @tests javax.net.ssl.SSLSocket#startHandshake()
697 SSLSocket ssl = getSSLSocket();
699 ssl.startHandshake();
795 * Implements a test SSL socket server. It wait for a connection on a given
888 SSLSocket ssl = null;
889 ssl = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
890 return ssl;
894 SSLSocket ssl = null;
895 ssl = (SSLSocket) SSLSocketFactory.getDefault().createSocket(host, port);
896 return ssl;
900 SSLSocket ssl = null;
901 ssl = (SSLSocket) SSLSocketFactory.getDefault().createSocket(host, port);
902 return ssl;
906 SSLSocket ssl = null;
907 ssl = (SSLSocket) SSLSocketFactory.getDefault().createSocket(host, port, localHost, localPort);
908 return ssl;
912 SSLSocket ssl = null;
913 ssl = (SSLSocket) SSLSocketFactory.getDefault().createSocket(host, port, localHost, localPort);
914 return ssl;