changeset 4477:345848aa62fa

7096936: issue in jsse/runtime 7096937: TEST: com/sun/net/ssl/internal/ssl/GenSSLConfigs/main.java need modification as a result of TLS fix Reviewed-by: wetmore, jdn, xuelei
author xuelei
date Fri, 30 Sep 2011 18:53:34 -0700
parents 14d8cc19f227
children 11f7d603acee
files src/share/classes/com/sun/net/ssl/HttpsURLConnection.java src/share/classes/javax/net/ssl/HttpsURLConnection.java test/sun/security/ssl/com/sun/net/ssl/internal/ssl/GenSSLConfigs/main.java
diffstat 3 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/net/ssl/HttpsURLConnection.java	Thu Sep 29 09:35:29 2011 -0700
+++ b/src/share/classes/com/sun/net/ssl/HttpsURLConnection.java	Fri Sep 30 18:53:34 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, 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
@@ -179,6 +179,12 @@
             throw new IllegalArgumentException(
                 "no SSLSocketFactory specified");
         }
+
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkSetFactory();
+        }
+
         sslSocketFactory = sf;
     }
 
--- a/src/share/classes/javax/net/ssl/HttpsURLConnection.java	Thu Sep 29 09:35:29 2011 -0700
+++ b/src/share/classes/javax/net/ssl/HttpsURLConnection.java	Fri Sep 30 18:53:34 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, 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
@@ -357,6 +357,10 @@
                 "no SSLSocketFactory specified");
         }
 
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkSetFactory();
+        }
         sslSocketFactory = sf;
     }
 
--- a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/GenSSLConfigs/main.java	Thu Sep 29 09:35:29 2011 -0700
+++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/GenSSLConfigs/main.java	Fri Sep 30 18:53:34 2011 -0700
@@ -1,7 +1,7 @@
 /*
  * @test
  * @build TestThread Traffic Handler ServerHandler ServerThread ClientThread
- * @run main/timeout=140 main
+ * @run main/othervm/timeout=140 -Djsse.enableCBCProtection=false main
  * @summary Make sure that different configurations of SSL sockets work
  */