Lines Matching refs:ssl
16 package tests.api.javax.net.ssl;
28 import javax.net.ssl.HandshakeCompletedEvent;
29 import javax.net.ssl.HandshakeCompletedListener;
30 import javax.net.ssl.KeyManager;
31 import javax.net.ssl.KeyManagerFactory;
32 import javax.net.ssl.SSLContext;
33 import javax.net.ssl.SSLServerSocket;
34 import javax.net.ssl.SSLSocket;
35 import javax.net.ssl.SSLSocketFactory;
36 import javax.net.ssl.TrustManager;
40 import tests.api.javax.net.ssl.HandshakeCompletedEventTest.TestTrustManager;
52 * javax.net.ssl.SSLSocket#SSLSocket()
55 SSLSocket ssl = getSSLSocket();
56 assertNotNull(ssl);
57 ssl.close();
61 * javax.net.ssl.SSLSocket#SSLSocket(InetAddress address, int port)
67 SSLSocket ssl = getSSLSocket(InetAddress.getLocalHost(), sport);
68 assertNotNull(ssl);
69 assertEquals(sport, ssl.getPort());
70 ssl.close();
88 * javax.net.ssl.SSLSocket#SSLSocket(InetAddress address, int port,
95 SSLSocket ssl = getSSLSocket(InetAddress.getLocalHost(), sport,
97 assertNotNull(ssl);
98 assertEquals(sport, ssl.getPort());
99 assertEquals(portNumber, ssl.getLocalPort());
100 ssl.close();
138 * javax.net.ssl.SSLSocket#SSLSocket(String host, int port)
144 SSLSocket ssl = getSSLSocket(InetAddress.getLocalHost().getHostName(), sport);
145 assertNotNull(ssl);
146 assertEquals(sport, ssl.getPort());
147 ssl.close();
171 * javax.net.ssl.SSLSocket#SSLSocket(String host, int port, InetAddress clientAddress,
179 SSLSocket ssl = getSSLSocket(InetAddress.getLocalHost().getHostName(), sport,
181 assertNotNull(ssl);
182 assertEquals(sport, ssl.getPort());
183 assertEquals(portNumber, ssl.getLocalPort());
231 * javax.net.ssl.SSLSocket#addHandshakeCompletedListener(HandshakeCompletedListener listener)
235 SSLSocket ssl = getSSLSocket();
238 ssl.addHandshakeCompletedListener(null);
242 ssl.addHandshakeCompletedListener(ls);
243 ssl.close();
247 * javax.net.ssl.SSLSocket#removeHandshakeCompletedListener(HandshakeCompletedListener listener)
250 SSLSocket ssl = getSSLSocket();
253 ssl.removeHandshakeCompletedListener(null);
259 ssl.removeHandshakeCompletedListener(ls);
263 ssl.addHandshakeCompletedListener(ls);
264 ssl.removeHandshakeCompletedListener(ls);
265 ssl.close();
269 * javax.net.ssl.SSLSocket#setEnableSessionCreation(boolean flag)
270 * javax.net.ssl.SSLSocket#getEnableSessionCreation()
273 SSLSocket ssl = getSSLSocket();
274 assertTrue(ssl.getEnableSessionCreation());
275 ssl.setEnableSessionCreation(false);
276 assertFalse(ssl.getEnableSessionCreation());
277 ssl.setEnableSessionCreation(true);
278 assertTrue(ssl.getEnableSessionCreation());
279 ssl.close();
283 * javax.net.ssl.SSLSocket#setNeedClientAuth(boolean need)
284 * javax.net.ssl.SSLSocket#getNeedClientAuthCreation()
287 SSLSocket ssl = getSSLSocket();
288 ssl.setNeedClientAuth(true);
289 assertTrue(ssl.getNeedClientAuth());
290 ssl.setNeedClientAuth(false);
291 assertFalse(ssl.getNeedClientAuth());
292 ssl.close();
296 * javax.net.ssl.SSLSocket#setWantClientAuth(boolean want)
297 * javax.net.ssl.SSLSocket#getWantClientAuthCreation()
300 SSLSocket ssl = getSSLSocket();
301 ssl.setWantClientAuth(true);
302 assertTrue(ssl.getWantClientAuth());
303 ssl.setWantClientAuth(false);
304 assertFalse(ssl.getWantClientAuth());
305 ssl.close();
309 * javax.net.ssl.SSLSocket#getSupportedProtocols()
312 SSLSocket ssl = getSSLSocket();
313 String[] res = ssl.getSupportedProtocols();
315 ssl.close();
319 * javax.net.ssl.SSLSocket#getEnabledProtocols()
320 * javax.net.ssl.SSLSocket#setEnabledProtocols(String[] protocols)
323 SSLSocket ssl = getSSLSocket();
325 ssl.setEnabledProtocols(null);
329 ssl.setEnabledProtocols(new String[] {});
331 ssl.setEnabledProtocols(new String[] {"blubb"});
335 ssl.setEnabledProtocols(ssl.getEnabledProtocols());
336 String[] res = ssl.getEnabledProtocols();
338 ssl.getEnabledProtocols().length, res.length);
339 ssl.close();
343 * javax.net.ssl.SSLSocket#getSession()
346 SSLSocket ssl = getSSLSocket();
347 assertNotNull(ssl.getSession());
348 ssl.close();
352 * javax.net.ssl.SSLSocket#getSupportedCipherSuites()
355 SSLSocket ssl = getSSLSocket();
356 String[] res = ssl.getSupportedCipherSuites();
358 ssl.close();
362 * javax.net.ssl.SSLSocket#getEnabledCipherSuites()
363 * javax.net.ssl.SSLSocket#setEnabledCipherSuites(String[] suites)
366 SSLSocket ssl = getSSLSocket();
368 ssl.setEnabledCipherSuites(null);
372 ssl.setEnabledCipherSuites(new String[] {});
374 ssl.setEnabledCipherSuites(new String[] {"blubb"});
378 ssl.setEnabledCipherSuites(ssl.getSupportedCipherSuites());
379 String[] res = ssl.getEnabledCipherSuites();
382 Arrays.asList(ssl.getSupportedCipherSuites()),
384 ssl.close();
388 * javax.net.ssl.SSLSocket#getUseClientMode()
389 * javax.net.ssl.SSLSocket#setUseClientMode(boolean mode)
392 SSLSocket ssl = getSSLSocket();
393 assertTrue(ssl.getUseClientMode());
394 ssl.setUseClientMode(false);
395 assertFalse(ssl.getUseClientMode());
396 ssl.close();
398 ssl = getSSLSocket("localhost", startServer("UseClientMode"));
400 ssl.startHandshake();
405 ssl.setUseClientMode(false);
409 ssl.close();
413 * javax.net.ssl.SSLSocket#startHandshake()
416 SSLSocket ssl = getSSLSocket();
418 ssl.startHandshake();
422 ssl.close();
514 * Implements a test SSL socket server. It wait for a connection on a given