Skip to content

Commit df86512

Browse files
committed
Rotate release notes as part of the 4.1.0 release
1 parent 87c2ff4 commit df86512

2 files changed

Lines changed: 41 additions & 41 deletions

File tree

.release-notes/4.1.0.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Add DTLSContext and DTLS for datagram TLS
2+
3+
`DTLSContext` and `DTLS` bring DTLS (datagram TLS) support. DTLS provides the same authentication and encryption as TLS over unreliable transports like UDP.
4+
5+
The API mirrors `SSLContext` and `SSL`. A `DTLSContext` creates client or server `DTLS` sessions; the session encrypts and decrypts application data through `write`, `read`, `receive`, and `send`, with the same return types (`SSLReceiveResult`, `SSLReadResult`).
6+
7+
```pony
8+
let ctx = recover val
9+
let c = DTLSContext
10+
c.set_cert(
11+
FilePath(auth, "cert.pem"),
12+
FilePath(auth, "key.pem"))?
13+
c.set_authority(FilePath(auth, "ca.pem"))?
14+
c.set_client_verify(true)
15+
c
16+
end
17+
18+
let session = ctx.client("server.example.com")?
19+
20+
// Feed encrypted bytes from the network into the session
21+
match session.receive(data_from_udp)
22+
| SSLReady => None // handshake complete
23+
| SSLAccepted => None // still handshaking
24+
| SSLAuthFail => // peer certificate rejected
25+
| SSLError => // protocol error
26+
end
27+
28+
// Encrypt application data for sending
29+
session.write("hello")?
30+
match session.send()
31+
| let out: Array[U8] iso => send_over_udp(consume out)
32+
end
33+
34+
// Read decrypted application data
35+
match session.read()
36+
| let plaintext: Array[U8] iso => // use it
37+
end
38+
```
39+
40+
`DTLSContext` and `SSLContext` are separate types because a TLS context cannot create a DTLS session and vice versa. Using separate types makes the wrong combination a compile error.
41+

.release-notes/next-release.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +0,0 @@
1-
## Add DTLSContext and DTLS for datagram TLS
2-
3-
`DTLSContext` and `DTLS` bring DTLS (datagram TLS) support. DTLS provides the same authentication and encryption as TLS over unreliable transports like UDP.
4-
5-
The API mirrors `SSLContext` and `SSL`. A `DTLSContext` creates client or server `DTLS` sessions; the session encrypts and decrypts application data through `write`, `read`, `receive`, and `send`, with the same return types (`SSLReceiveResult`, `SSLReadResult`).
6-
7-
```pony
8-
let ctx = recover val
9-
let c = DTLSContext
10-
c.set_cert(
11-
FilePath(auth, "cert.pem"),
12-
FilePath(auth, "key.pem"))?
13-
c.set_authority(FilePath(auth, "ca.pem"))?
14-
c.set_client_verify(true)
15-
c
16-
end
17-
18-
let session = ctx.client("server.example.com")?
19-
20-
// Feed encrypted bytes from the network into the session
21-
match session.receive(data_from_udp)
22-
| SSLReady => None // handshake complete
23-
| SSLAccepted => None // still handshaking
24-
| SSLAuthFail => // peer certificate rejected
25-
| SSLError => // protocol error
26-
end
27-
28-
// Encrypt application data for sending
29-
session.write("hello")?
30-
match session.send()
31-
| let out: Array[U8] iso => send_over_udp(consume out)
32-
end
33-
34-
// Read decrypted application data
35-
match session.read()
36-
| let plaintext: Array[U8] iso => // use it
37-
end
38-
```
39-
40-
`DTLSContext` and `SSLContext` are separate types because a TLS context cannot create a DTLS session and vice versa. Using separate types makes the wrong combination a compile error.
41-

0 commit comments

Comments
 (0)