equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
355 SSLContext context = getSSLContext(false); |
355 SSLContext context = getSSLContext(false); |
356 SSLSocketFactory sslsf = context.getSocketFactory(); |
356 SSLSocketFactory sslsf = context.getSocketFactory(); |
357 |
357 |
358 SSLSocket sslSocket = |
358 SSLSocket sslSocket = |
359 (SSLSocket)sslsf.createSocket("localhost", serverPort); |
359 (SSLSocket)sslsf.createSocket("localhost", serverPort); |
|
360 sslSocket.setEnabledProtocols(new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" }); |
360 try { |
361 try { |
361 InputStream sslIS = sslSocket.getInputStream(); |
362 InputStream sslIS = sslSocket.getInputStream(); |
362 OutputStream sslOS = sslSocket.getOutputStream(); |
363 OutputStream sslOS = sslSocket.getOutputStream(); |
363 |
364 |
364 sslOS.write(280); |
365 sslOS.write(280); |