109 SSLSocketFactory fac = (SSLSocketFactory)cls.newInstance();
110 log("instantiated an instance of class " + clsName);
111 theFactory = fac;
112 return fac;
113 } catch (Exception e) {
114 log("SSLSocketFactory instantiation failed: " + e.toString());
115 theFactory = new DefaultSSLSocketFactory(e);
116 return theFactory;
117 }
118 }
119 }
120
121 try {
122 return SSLContext.getDefault().getSocketFactory();
123 } catch (NoSuchAlgorithmException e) {
124 return new DefaultSSLSocketFactory(e);
125 }
126 }
127
128 static String getSecurityProperty(final String name) {
129 return AccessController.doPrivileged(new PrivilegedAction<String>() {
130 @Override
131 public String run() {
132 String s = java.security.Security.getProperty(name);
133 if (s != null) {
134 s = s.trim();
135 if (s.length() == 0) {
136 s = null;
137 }
138 }
139 return s;
140 }
141 });
142 }
143
144 /**
145 * Returns the list of cipher suites which are enabled by default.
146 * Unless a different list is enabled, handshaking on an SSL connection
147 * will use one of these cipher suites. The minimum quality of service
148 * for these defaults requires confidentiality protection and server
149 * authentication (that is, no anonymous cipher suites).
|
109 SSLSocketFactory fac = (SSLSocketFactory)cls.newInstance();
110 log("instantiated an instance of class " + clsName);
111 theFactory = fac;
112 return fac;
113 } catch (Exception e) {
114 log("SSLSocketFactory instantiation failed: " + e.toString());
115 theFactory = new DefaultSSLSocketFactory(e);
116 return theFactory;
117 }
118 }
119 }
120
121 try {
122 return SSLContext.getDefault().getSocketFactory();
123 } catch (NoSuchAlgorithmException e) {
124 return new DefaultSSLSocketFactory(e);
125 }
126 }
127
128 static String getSecurityProperty(final String name) {
129 return AccessController.doPrivileged(new PrivilegedAction<>() {
130 @Override
131 public String run() {
132 String s = java.security.Security.getProperty(name);
133 if (s != null) {
134 s = s.trim();
135 if (s.length() == 0) {
136 s = null;
137 }
138 }
139 return s;
140 }
141 });
142 }
143
144 /**
145 * Returns the list of cipher suites which are enabled by default.
146 * Unless a different list is enabled, handshaking on an SSL connection
147 * will use one of these cipher suites. The minimum quality of service
148 * for these defaults requires confidentiality protection and server
149 * authentication (that is, no anonymous cipher suites).
|