author | wetmore |
Fri, 11 May 2018 15:53:12 -0700 | |
branch | JDK-8145252-TLS13-branch |
changeset 56542 | 56aaa6cb3693 |
parent 48225 | src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java@718669e6b375 |
child 56715 | b152d06ed6a9 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
56542 | 2 |
* Copyright (c) 2018, 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 sun.security.ssl; |
|
27 |
||
56542 | 28 |
import java.io.IOException; |
29 |
import java.security.AlgorithmConstraints; |
|
30 |
import java.security.AccessController; |
|
31689 | 31 |
import sun.security.util.LegacyAlgorithmConstraints; |
20539
cbff16f695c6
6956398: make ephemeral DH key match the length of the certificate key
xuelei
parents:
19823
diff
changeset
|
32 |
import sun.security.action.GetPropertyAction; |
56542 | 33 |
import sun.security.action.GetLongAction; |
2 | 34 |
|
56542 | 35 |
class ServerHandshakeContext extends HandshakeContext { |
36 |
// To prevent the TLS renegotiation issues, by setting system property |
|
37 |
// "jdk.tls.rejectClientInitiatedRenegotiation" to true, applications in |
|
38 |
// server side can disable all client initiated SSL renegotiations |
|
39 |
// regardless of the support of TLS protocols. |
|
40 |
// |
|
41 |
// By default, allow client initiated renegotiations. |
|
42 |
static final boolean rejectClientInitiatedRenego = |
|
43 |
Utilities.getBooleanProperty( |
|
44 |
"jdk.tls.rejectClientInitiatedRenegotiation", false); |
|
20539
cbff16f695c6
6956398: make ephemeral DH key match the length of the certificate key
xuelei
parents:
19823
diff
changeset
|
45 |
|
31689 | 46 |
// legacy algorithm constraints |
56542 | 47 |
static final AlgorithmConstraints legacyAlgorithmConstraints = |
31689 | 48 |
new LegacyAlgorithmConstraints( |
49 |
LegacyAlgorithmConstraints.PROPERTY_TLS_LEGACY_ALGS, |
|
50 |
new SSLAlgorithmDecomposer()); |
|
51 |
||
56542 | 52 |
// temporary authentication information |
53 |
SSLPossession interimAuthn; |
|
2 | 54 |
|
56542 | 55 |
StatusResponseManager.StaplingParameters stapleParams; |
56 |
CertificateMessage.CertificateEntry currentCertEntry; |
|
57 |
private static final long DEFAULT_STATUS_RESP_DELAY = 5000L; |
|
58 |
final long statusRespTimeout; |
|
2 | 59 |
|
60 |
||
56542 | 61 |
ServerHandshakeContext(SSLContextImpl sslContext, |
62 |
TransportContext conContext) throws IOException { |
|
63 |
super(sslContext, conContext); |
|
64 |
long respTimeOut = AccessController.doPrivileged( |
|
65 |
new GetLongAction("jdk.tls.stapling.responseTimeout", |
|
66 |
DEFAULT_STATUS_RESP_DELAY)); |
|
67 |
statusRespTimeout = respTimeOut >= 0 ? respTimeOut : |
|
68 |
DEFAULT_STATUS_RESP_DELAY; |
|
69 |
handshakeConsumers.put( |
|
70 |
SSLHandshake.CLIENT_HELLO.id, SSLHandshake.CLIENT_HELLO); |
|
71 |
} |
|
14194
971f46db533d
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents:
12874
diff
changeset
|
72 |
|
56542 | 73 |
@Override |
74 |
void kickstart() throws IOException { |
|
75 |
if (!conContext.isNegotiated || kickstartMessageDelivered) { |
|
2 | 76 |
return; |
77 |
} |
|
78 |
||
56542 | 79 |
SSLHandshake.kickstart(this); |
80 |
kickstartMessageDelivered = true; |
|
36442
ce858cc19004
8132942: ServerHandshaker should not throw SSLHandshakeException when CertificateStatus constructor is called with invalid arguments
jnimeh
parents:
36132
diff
changeset
|
81 |
} |
2 | 82 |
} |
56542 | 83 |