changeset 8245:c029922f0006

8078348: sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java fails with BindException Reviewed-by: xuelei
author vinnie
date Mon, 06 Jul 2015 21:57:49 +0100
parents d109922ed5ac
children c6ba5a410219
files test/sun/security/pkcs11/sslecc/CipherTest.java test/sun/security/pkcs11/sslecc/JSSEServer.java
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/sun/security/pkcs11/sslecc/CipherTest.java	Mon Jul 06 21:56:19 2015 +0100
+++ b/test/sun/security/pkcs11/sslecc/CipherTest.java	Mon Jul 06 21:57:49 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
 public class CipherTest {
 
     // use any available port for the server socket
-    static int serverPort = 0;
+    static volatile int serverPort = 0;
 
     final int THREADS;
 
--- a/test/sun/security/pkcs11/sslecc/JSSEServer.java	Mon Jul 06 21:56:19 2015 +0100
+++ b/test/sun/security/pkcs11/sslecc/JSSEServer.java	Mon Jul 06 21:57:49 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
         serverContext.init(new KeyManager[] {cipherTest.keyManager}, new TrustManager[] {cipherTest.trustManager}, cipherTest.secureRandom);
 
         SSLServerSocketFactory factory = (SSLServerSocketFactory)serverContext.getServerSocketFactory();
-        serverSocket = (SSLServerSocket)factory.createServerSocket(cipherTest.serverPort);
+        serverSocket = (SSLServerSocket)factory.createServerSocket(0);
         cipherTest.serverPort = serverSocket.getLocalPort();
         serverSocket.setEnabledCipherSuites(factory.getSupportedCipherSuites());
         serverSocket.setWantClientAuth(true);