author | avstepan |
Mon, 16 Mar 2015 19:09:13 +0400 | |
changeset 29492 | a4bf9a570035 |
parent 25859 | 3317bb8137f4 |
child 30904 | ec0224270f90 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
29492
a4bf9a570035
8028266: Tidy warnings cleanup for packages java.security/javax.security
avstepan
parents:
25859
diff
changeset
|
2 |
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package javax.net.ssl; |
|
27 |
||
7043 | 28 |
import java.security.AlgorithmConstraints; |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
29 |
import java.util.Map; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
30 |
import java.util.List; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
31 |
import java.util.HashMap; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
32 |
import java.util.ArrayList; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
33 |
import java.util.Collection; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
34 |
import java.util.Collections; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
35 |
import java.util.LinkedHashMap; |
7043 | 36 |
|
2 | 37 |
/** |
38 |
* Encapsulates parameters for an SSL/TLS connection. The parameters |
|
39 |
* are the list of ciphersuites to be accepted in an SSL/TLS handshake, |
|
7043 | 40 |
* the list of protocols to be allowed, the endpoint identification |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
41 |
* algorithm during SSL/TLS handshaking, the Server Name Indication (SNI), |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
42 |
* the algorithm constraints and whether SSL/TLS servers should request |
19823
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
43 |
* or require client authentication, etc. |
7043 | 44 |
* <p> |
45 |
* SSLParameters can be created via the constructors in this class. |
|
2 | 46 |
* Objects can also be obtained using the <code>getSSLParameters()</code> |
47 |
* methods in |
|
48 |
* {@link SSLSocket#getSSLParameters SSLSocket} and |
|
7043 | 49 |
* {@link SSLServerSocket#getSSLParameters SSLServerSocket} and |
2 | 50 |
* {@link SSLEngine#getSSLParameters SSLEngine} or the |
51 |
* {@link SSLContext#getDefaultSSLParameters getDefaultSSLParameters()} and |
|
52 |
* {@link SSLContext#getSupportedSSLParameters getSupportedSSLParameters()} |
|
53 |
* methods in <code>SSLContext</code>. |
|
7043 | 54 |
* <p> |
55 |
* SSLParameters can be applied to a connection via the methods |
|
2 | 56 |
* {@link SSLSocket#setSSLParameters SSLSocket.setSSLParameters()} and |
7043 | 57 |
* {@link SSLServerSocket#setSSLParameters SSLServerSocket.setSSLParameters()} |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
58 |
* and {@link SSLEngine#setSSLParameters SSLEngine.setSSLParameters()}. |
2 | 59 |
* |
60 |
* @see SSLSocket |
|
61 |
* @see SSLEngine |
|
62 |
* @see SSLContext |
|
63 |
* |
|
64 |
* @since 1.6 |
|
65 |
*/ |
|
66 |
public class SSLParameters { |
|
67 |
||
68 |
private String[] cipherSuites; |
|
69 |
private String[] protocols; |
|
70 |
private boolean wantClientAuth; |
|
71 |
private boolean needClientAuth; |
|
7043 | 72 |
private String identificationAlgorithm; |
73 |
private AlgorithmConstraints algorithmConstraints; |
|
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
74 |
private Map<Integer, SNIServerName> sniNames = null; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
75 |
private Map<Integer, SNIMatcher> sniMatchers = null; |
19823
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
76 |
private boolean preferLocalCipherSuites; |
2 | 77 |
|
78 |
/** |
|
79 |
* Constructs SSLParameters. |
|
7043 | 80 |
* <p> |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
81 |
* The values of cipherSuites, protocols, cryptographic algorithm |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
82 |
* constraints, endpoint identification algorithm, server names and |
19823
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
83 |
* server name matchers are set to <code>null</code>, useCipherSuitesOrder, |
2 | 84 |
* wantClientAuth and needClientAuth are set to <code>false</code>. |
85 |
*/ |
|
86 |
public SSLParameters() { |
|
87 |
// empty |
|
88 |
} |
|
89 |
||
90 |
/** |
|
91 |
* Constructs SSLParameters from the specified array of ciphersuites. |
|
7043 | 92 |
* <p> |
2 | 93 |
* Calling this constructor is equivalent to calling the no-args |
94 |
* constructor followed by |
|
95 |
* <code>setCipherSuites(cipherSuites);</code>. |
|
96 |
* |
|
97 |
* @param cipherSuites the array of ciphersuites (or null) |
|
98 |
*/ |
|
99 |
public SSLParameters(String[] cipherSuites) { |
|
100 |
setCipherSuites(cipherSuites); |
|
101 |
} |
|
102 |
||
103 |
/** |
|
104 |
* Constructs SSLParameters from the specified array of ciphersuites |
|
105 |
* and protocols. |
|
7043 | 106 |
* <p> |
2 | 107 |
* Calling this constructor is equivalent to calling the no-args |
108 |
* constructor followed by |
|
109 |
* <code>setCipherSuites(cipherSuites); setProtocols(protocols);</code>. |
|
110 |
* |
|
111 |
* @param cipherSuites the array of ciphersuites (or null) |
|
112 |
* @param protocols the array of protocols (or null) |
|
113 |
*/ |
|
114 |
public SSLParameters(String[] cipherSuites, String[] protocols) { |
|
115 |
setCipherSuites(cipherSuites); |
|
116 |
setProtocols(protocols); |
|
117 |
} |
|
118 |
||
119 |
private static String[] clone(String[] s) { |
|
120 |
return (s == null) ? null : s.clone(); |
|
121 |
} |
|
122 |
||
123 |
/** |
|
124 |
* Returns a copy of the array of ciphersuites or null if none |
|
125 |
* have been set. |
|
126 |
* |
|
127 |
* @return a copy of the array of ciphersuites or null if none |
|
128 |
* have been set. |
|
129 |
*/ |
|
130 |
public String[] getCipherSuites() { |
|
131 |
return clone(cipherSuites); |
|
132 |
} |
|
133 |
||
134 |
/** |
|
135 |
* Sets the array of ciphersuites. |
|
136 |
* |
|
137 |
* @param cipherSuites the array of ciphersuites (or null) |
|
138 |
*/ |
|
139 |
public void setCipherSuites(String[] cipherSuites) { |
|
140 |
this.cipherSuites = clone(cipherSuites); |
|
141 |
} |
|
142 |
||
143 |
/** |
|
144 |
* Returns a copy of the array of protocols or null if none |
|
145 |
* have been set. |
|
146 |
* |
|
147 |
* @return a copy of the array of protocols or null if none |
|
148 |
* have been set. |
|
149 |
*/ |
|
150 |
public String[] getProtocols() { |
|
151 |
return clone(protocols); |
|
152 |
} |
|
153 |
||
154 |
/** |
|
155 |
* Sets the array of protocols. |
|
156 |
* |
|
157 |
* @param protocols the array of protocols (or null) |
|
158 |
*/ |
|
159 |
public void setProtocols(String[] protocols) { |
|
160 |
this.protocols = clone(protocols); |
|
161 |
} |
|
162 |
||
163 |
/** |
|
164 |
* Returns whether client authentication should be requested. |
|
165 |
* |
|
166 |
* @return whether client authentication should be requested. |
|
167 |
*/ |
|
168 |
public boolean getWantClientAuth() { |
|
169 |
return wantClientAuth; |
|
170 |
} |
|
171 |
||
172 |
/** |
|
173 |
* Sets whether client authentication should be requested. Calling |
|
174 |
* this method clears the <code>needClientAuth</code> flag. |
|
175 |
* |
|
176 |
* @param wantClientAuth whether client authentication should be requested |
|
177 |
*/ |
|
178 |
public void setWantClientAuth(boolean wantClientAuth) { |
|
179 |
this.wantClientAuth = wantClientAuth; |
|
180 |
this.needClientAuth = false; |
|
181 |
} |
|
182 |
||
183 |
/** |
|
184 |
* Returns whether client authentication should be required. |
|
185 |
* |
|
186 |
* @return whether client authentication should be required. |
|
187 |
*/ |
|
188 |
public boolean getNeedClientAuth() { |
|
189 |
return needClientAuth; |
|
190 |
} |
|
191 |
||
192 |
/** |
|
193 |
* Sets whether client authentication should be required. Calling |
|
194 |
* this method clears the <code>wantClientAuth</code> flag. |
|
195 |
* |
|
196 |
* @param needClientAuth whether client authentication should be required |
|
197 |
*/ |
|
198 |
public void setNeedClientAuth(boolean needClientAuth) { |
|
199 |
this.wantClientAuth = false; |
|
200 |
this.needClientAuth = needClientAuth; |
|
201 |
} |
|
202 |
||
7043 | 203 |
/** |
204 |
* Returns the cryptographic algorithm constraints. |
|
205 |
* |
|
206 |
* @return the cryptographic algorithm constraints, or null if the |
|
207 |
* constraints have not been set |
|
208 |
* |
|
209 |
* @see #setAlgorithmConstraints(AlgorithmConstraints) |
|
210 |
* |
|
211 |
* @since 1.7 |
|
212 |
*/ |
|
213 |
public AlgorithmConstraints getAlgorithmConstraints() { |
|
214 |
return algorithmConstraints; |
|
215 |
} |
|
216 |
||
217 |
/** |
|
218 |
* Sets the cryptographic algorithm constraints, which will be used |
|
219 |
* in addition to any configured by the runtime environment. |
|
220 |
* <p> |
|
221 |
* If the <code>constraints</code> parameter is non-null, every |
|
222 |
* cryptographic algorithm, key and algorithm parameters used in the |
|
223 |
* SSL/TLS handshake must be permitted by the constraints. |
|
224 |
* |
|
225 |
* @param constraints the algorithm constraints (or null) |
|
226 |
* |
|
227 |
* @since 1.7 |
|
228 |
*/ |
|
229 |
public void setAlgorithmConstraints(AlgorithmConstraints constraints) { |
|
230 |
// the constraints object is immutable |
|
231 |
this.algorithmConstraints = constraints; |
|
232 |
} |
|
233 |
||
234 |
/** |
|
235 |
* Gets the endpoint identification algorithm. |
|
236 |
* |
|
237 |
* @return the endpoint identification algorithm, or null if none |
|
238 |
* has been set. |
|
239 |
* |
|
240 |
* @see X509ExtendedTrustManager |
|
241 |
* @see #setEndpointIdentificationAlgorithm(String) |
|
242 |
* |
|
243 |
* @since 1.7 |
|
244 |
*/ |
|
245 |
public String getEndpointIdentificationAlgorithm() { |
|
246 |
return identificationAlgorithm; |
|
247 |
} |
|
248 |
||
249 |
/** |
|
250 |
* Sets the endpoint identification algorithm. |
|
251 |
* <p> |
|
252 |
* If the <code>algorithm</code> parameter is non-null or non-empty, the |
|
253 |
* endpoint identification/verification procedures must be handled during |
|
254 |
* SSL/TLS handshaking. This is to prevent man-in-the-middle attacks. |
|
255 |
* |
|
256 |
* @param algorithm The standard string name of the endpoint |
|
257 |
* identification algorithm (or null). See Appendix A in the <a href= |
|
11838 | 258 |
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA"> |
7043 | 259 |
* Java Cryptography Architecture API Specification & Reference </a> |
260 |
* for information about standard algorithm names. |
|
261 |
* |
|
262 |
* @see X509ExtendedTrustManager |
|
263 |
* |
|
264 |
* @since 1.7 |
|
265 |
*/ |
|
266 |
public void setEndpointIdentificationAlgorithm(String algorithm) { |
|
267 |
this.identificationAlgorithm = algorithm; |
|
268 |
} |
|
269 |
||
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
270 |
/** |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
271 |
* Sets the desired {@link SNIServerName}s of the Server Name |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
272 |
* Indication (SNI) parameter. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
273 |
* <P> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
274 |
* This method is only useful to {@link SSLSocket}s or {@link SSLEngine}s |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
275 |
* operating in client mode. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
276 |
* <P> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
277 |
* Note that the {@code serverNames} list is cloned |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
278 |
* to protect against subsequent modification. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
279 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
280 |
* @param serverNames |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
281 |
* the list of desired {@link SNIServerName}s (or null) |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
282 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
283 |
* @throws NullPointerException if the {@code serverNames} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
284 |
* contains {@code null} element |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
285 |
* @throws IllegalArgumentException if the {@code serverNames} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
286 |
* contains more than one name of the same name type |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
287 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
288 |
* @see SNIServerName |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
289 |
* @see #getServerNames() |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
290 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
291 |
* @since 1.8 |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
292 |
*/ |
14196
1ebcd181a423
8000954: Add final keyword to new method in SSLParameters
xuelei
parents:
14194
diff
changeset
|
293 |
public final void setServerNames(List<SNIServerName> serverNames) { |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
294 |
if (serverNames != null) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
295 |
if (!serverNames.isEmpty()) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
296 |
sniNames = new LinkedHashMap<>(serverNames.size()); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
297 |
for (SNIServerName serverName : serverNames) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
298 |
if (sniNames.put(serverName.getType(), |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
299 |
serverName) != null) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
300 |
throw new IllegalArgumentException( |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
301 |
"Duplicated server name of type " + |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
302 |
serverName.getType()); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
303 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
304 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
305 |
} else { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
306 |
sniNames = Collections.<Integer, SNIServerName>emptyMap(); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
307 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
308 |
} else { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
309 |
sniNames = null; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
310 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
311 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
312 |
|
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
313 |
/** |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
314 |
* Returns a {@link List} containing all {@link SNIServerName}s of the |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
315 |
* Server Name Indication (SNI) parameter, or null if none has been set. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
316 |
* <P> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
317 |
* This method is only useful to {@link SSLSocket}s or {@link SSLEngine}s |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
318 |
* operating in client mode. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
319 |
* <P> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
320 |
* For SSL/TLS connections, the underlying SSL/TLS provider |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
321 |
* may specify a default value for a certain server name type. In |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
322 |
* client mode, it is recommended that, by default, providers should |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
323 |
* include the server name indication whenever the server can be located |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
324 |
* by a supported server name type. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
325 |
* <P> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
326 |
* It is recommended that providers initialize default Server Name |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
327 |
* Indications when creating {@code SSLSocket}/{@code SSLEngine}s. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
328 |
* In the following examples, the server name could be represented by an |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
329 |
* instance of {@link SNIHostName} which has been initialized with the |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
330 |
* hostname "www.example.com" and type |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
331 |
* {@link StandardConstants#SNI_HOST_NAME}. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
332 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
333 |
* <pre> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
334 |
* Socket socket = |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
335 |
* sslSocketFactory.createSocket("www.example.com", 443); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
336 |
* </pre> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
337 |
* or |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
338 |
* <pre> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
339 |
* SSLEngine engine = |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
340 |
* sslContext.createSSLEngine("www.example.com", 443); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
341 |
* </pre> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
342 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
343 |
* @return null or an immutable list of non-null {@link SNIServerName}s |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
344 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
345 |
* @see List |
14663 | 346 |
* @see #setServerNames(List) |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
347 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
348 |
* @since 1.8 |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
349 |
*/ |
14196
1ebcd181a423
8000954: Add final keyword to new method in SSLParameters
xuelei
parents:
14194
diff
changeset
|
350 |
public final List<SNIServerName> getServerNames() { |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
351 |
if (sniNames != null) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
352 |
if (!sniNames.isEmpty()) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
353 |
return Collections.<SNIServerName>unmodifiableList( |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
354 |
new ArrayList<>(sniNames.values())); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
355 |
} else { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
356 |
return Collections.<SNIServerName>emptyList(); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
357 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
358 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
359 |
|
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
360 |
return null; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
361 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
362 |
|
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
363 |
/** |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
364 |
* Sets the {@link SNIMatcher}s of the Server Name Indication (SNI) |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
365 |
* parameter. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
366 |
* <P> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
367 |
* This method is only useful to {@link SSLSocket}s or {@link SSLEngine}s |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
368 |
* operating in server mode. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
369 |
* <P> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
370 |
* Note that the {@code matchers} collection is cloned to protect |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
371 |
* against subsequent modification. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
372 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
373 |
* @param matchers |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
374 |
* the collection of {@link SNIMatcher}s (or null) |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
375 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
376 |
* @throws NullPointerException if the {@code matchers} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
377 |
* contains {@code null} element |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
378 |
* @throws IllegalArgumentException if the {@code matchers} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
379 |
* contains more than one name of the same name type |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
380 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
381 |
* @see Collection |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
382 |
* @see SNIMatcher |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
383 |
* @see #getSNIMatchers() |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
384 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
385 |
* @since 1.8 |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
386 |
*/ |
14196
1ebcd181a423
8000954: Add final keyword to new method in SSLParameters
xuelei
parents:
14194
diff
changeset
|
387 |
public final void setSNIMatchers(Collection<SNIMatcher> matchers) { |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
388 |
if (matchers != null) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
389 |
if (!matchers.isEmpty()) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
390 |
sniMatchers = new HashMap<>(matchers.size()); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
391 |
for (SNIMatcher matcher : matchers) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
392 |
if (sniMatchers.put(matcher.getType(), |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
393 |
matcher) != null) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
394 |
throw new IllegalArgumentException( |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
395 |
"Duplicated server name of type " + |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
396 |
matcher.getType()); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
397 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
398 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
399 |
} else { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
400 |
sniMatchers = Collections.<Integer, SNIMatcher>emptyMap(); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
401 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
402 |
} else { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
403 |
sniMatchers = null; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
404 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
405 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
406 |
|
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
407 |
/** |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
408 |
* Returns a {@link Collection} containing all {@link SNIMatcher}s of the |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
409 |
* Server Name Indication (SNI) parameter, or null if none has been set. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
410 |
* <P> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
411 |
* This method is only useful to {@link SSLSocket}s or {@link SSLEngine}s |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
412 |
* operating in server mode. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
413 |
* <P> |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
414 |
* For better interoperability, providers generally will not define |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
415 |
* default matchers so that by default servers will ignore the SNI |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
416 |
* extension and continue the handshake. |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
417 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
418 |
* @return null or an immutable collection of non-null {@link SNIMatcher}s |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
419 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
420 |
* @see SNIMatcher |
14663 | 421 |
* @see #setSNIMatchers(Collection) |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
422 |
* |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
423 |
* @since 1.8 |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
424 |
*/ |
14196
1ebcd181a423
8000954: Add final keyword to new method in SSLParameters
xuelei
parents:
14194
diff
changeset
|
425 |
public final Collection<SNIMatcher> getSNIMatchers() { |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
426 |
if (sniMatchers != null) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
427 |
if (!sniMatchers.isEmpty()) { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
428 |
return Collections.<SNIMatcher>unmodifiableList( |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
429 |
new ArrayList<>(sniMatchers.values())); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
430 |
} else { |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
431 |
return Collections.<SNIMatcher>emptyList(); |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
432 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
433 |
} |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
434 |
|
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
435 |
return null; |
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
436 |
} |
19823
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
437 |
|
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
438 |
/** |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
439 |
* Sets whether the local cipher suites preference should be honored. |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
440 |
* |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
441 |
* @param honorOrder whether local cipher suites order in |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
442 |
* {@code #getCipherSuites} should be honored during |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
443 |
* SSL/TLS handshaking. |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
444 |
* |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
445 |
* @see #getUseCipherSuitesOrder() |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
446 |
* |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
447 |
* @since 1.8 |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
448 |
*/ |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
449 |
public final void setUseCipherSuitesOrder(boolean honorOrder) { |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
450 |
this.preferLocalCipherSuites = honorOrder; |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
451 |
} |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
452 |
|
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
453 |
/** |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
454 |
* Returns whether the local cipher suites preference should be honored. |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
455 |
* |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
456 |
* @return whether local cipher suites order in {@code #getCipherSuites} |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
457 |
* should be honored during SSL/TLS handshaking. |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
458 |
* |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
459 |
* @see #setUseCipherSuitesOrder(boolean) |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
460 |
* |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
461 |
* @since 1.8 |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
462 |
*/ |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
463 |
public final boolean getUseCipherSuitesOrder() { |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
464 |
return preferLocalCipherSuites; |
f0fd09e20528
7188657: There should be a way to reorder the JSSE ciphers
xuelei
parents:
14663
diff
changeset
|
465 |
} |
2 | 466 |
} |
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
11838
diff
changeset
|
467 |