-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathtls-default.yaml
More file actions
52 lines (52 loc) · 1.69 KB
/
tls-default.yaml
File metadata and controls
52 lines (52 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
id: 79
slug: "tls-default"
title: "TLS 1.3 by default"
category: "security"
difficulty: "intermediate"
jdkVersion: "11"
oldLabel: "Java 8"
modernLabel: "Java 11+"
oldApproach: "Manual TLS Config"
modernApproach: "TLS 1.3 Default"
oldCode: |-
SSLContext ctx =
SSLContext.getInstance("TLSv1.2");
ctx.init(null, trustManagers, null);
SSLSocketFactory factory =
ctx.getSocketFactory();
// Must specify protocol version
modernCode: |-
// TLS 1.3 is the default!
var client = HttpClient.newBuilder()
.sslContext(SSLContext.getDefault())
.build();
// Already using TLS 1.3
summary: "TLS 1.3 is enabled by default — no explicit protocol configuration needed."
explanation: "Java 11 added TLS 1.3 support and made it the preferred protocol. The\
\ HttpClient uses it automatically. No more manually specifying protocol versions\
\ for secure connections."
whyModernWins:
- icon: "🛡️"
title: "More secure"
desc: "TLS 1.3 removes obsolete cipher suites and handshake patterns."
- icon: "⚡"
title: "Faster handshake"
desc: "TLS 1.3 completes in one round trip vs two."
- icon: "🆓"
title: "Zero config"
desc: "Secure by default — no explicit protocol selection needed."
support:
state: "available"
description: "Widely available since JDK 11 (Sept 2018)"
prev: "security/strong-random"
next: "security/random-generator"
related:
- "security/pem-encoding"
- "security/key-derivation-functions"
- "security/strong-random"
docs:
- title: "SSLContext"
href: "https://docs.oracle.com/en/java/javase/25/docs/api/java.base/javax/net/ssl/SSLContext.html"
- title: "Java Security Guide"
href: "https://docs.oracle.com/en/java/javase/25/security/java-security-overview1.html"