Summary
Provide new system properties, namely jdk.tls.server.maxInboundCertificateChainLength and jdk.tls.client.maxInboundCertificateChainLength, to limit the certificate chain length for TLS servers and clients during TLS handshaking.
Problem
The existing jdk.tls.maxCertificateChainLength system property configures the maximum allowed certificate chain length without distinguishing between chains originating from servers or clients. However, there may be situations in which a service may want to impose different limits on the certificate chain length for clients that connect to it and servers that it connects to.
Solution
The solution introduces two new system properties: jdk.tls.server.maxInboundCertificateChainLength and jdk.tls.client.maxInboundCertificateChainLength.
As a service can function as both a TLS server and client, it is useful to have separate system properties to control the maximum certificate chain length accepted from the client or server.
- When the service acts as a client, it enforces a maximum certificate chain length accepted from servers, as set in the
jdk.tls.client.maxInboundCertificateChainLengthproperty. Its default is 10. - When the service acts as a server, it enforces a maximum certificate chain length accepted from clients, as set in the
jdk.tls.server.maxInboundCertificateChainLengthproperty. Its default is 8. - If the
jdk.tls.server.maxInboundCertificateChainLengthorjdk.tls.client.maxInboundCertificateChainLengthproperty is set to a negative value, it will keep its original default.
If the jdk.tls.server.maxInboundCertificateChainLength system property is set and its value is greater than or equal to 0, this value will be used to enforce the maximum length of a client certificate chain accepted by a server. Otherwise, if the jdk.tls.maxCertificateChainLength system property is set and its value is greater than or equal to 0, this value will be used to enforce it; or the jdk.tls.maxCertificateChainLength system property is not set, the default value of 8 will be used for enforcement.
If the jdk.tls.client.maxInboundCertificateChainLength system property is set and its value is greater than or equal to 0, this value will be used to enforce the maximum length of a server certificate chain accepted by a client. Otherwise, if the jdk.tls.maxCertificateChainLength system property is set and its value is greater than or equal to 0, this value will be used to enforce it; or the jdk.tls.maxCertificateChainLength system property is not set, the default value of 10 will be used for enforcement.
The existing jdk.tls.maxCertificateChainLength system property is changed from its original default value of 10 to 8 for client certificate chains.
Enforcement of the certificate chain length is performed in the TLS Handshaking Protocol for the server and client certificate messages. When the certificate chain length exceeds the maximum allowed length, an SSLProtocolException is thrown.
Specification
There are no API changes. Two new system properties, jdk.tls.server.maxInboundCertificateChainLength and jdk.tls.client.maxInboundCertificateChainLength, are introduced as described in the "Solution" section.
Document new system properties in a release note (JDK-8313242) and in the security guides (JDK-8313243).
Changes to Security Guide:
In Customizing JSSE section: Add two new system properties to Table 8-3 System Properties and Customized Items
Property
- System Property:
jdk.tls.client.maxInboundCertificateChainLength - Customized Item: Maximum certificate chain length accepted from servers
- Default: 10
- Note: None
Property
- System Property:
jdk.tls.server.maxInboundCertificateChainLength - Customized Item: Maximum certificate chain length accepted from clients
- Default: 8
- Note: None
- csr of
-
JDK-8311596 Add separate system properties for TLS server and client for maximum chain length
-
- Resolved
-