Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@theodorsm
Copy link
Member

Description

I have made a WIP DTLS 1.3 configuration and architecture.

As suggested by @JoeTurki, it implementes a functional options pattern to provide flexibility in the future. A DTLS 1.3 configuration is created with NewConfigVersion13(c Config, opts ...OptionVersion13) (*Config, error) where an option/config can be implemented like this:

func WithOption13(f func(b bool)) OptionVersion13 {
	return func(c *Config) error {
		c.comeConfig = b
		return nil
	}
}
*/

The codebase for DTLS 1.2 and DTLS 1.3 splits off in conn.go with the new handshake13 function and the new handshakeFSM in handshaker_13.go (note that neither reflects DTLS 1.3 logic yet, just a copy/paste). I suggest we split off as much code as possible suffixed with _13 (flight0handler_13.go etc...), to keep the development of DTLS 1.3 separate from 1.2.

This PR contains a test of enabling DTLS 1.3 and verifies that an error is returned correctly, as we have not yet started to implement DTLS 1.3 flights.

I would appreciate some input from other maintainers on this! @JoeTurki, @daenney, @Sean-Der.

Reference issue

Fixes #731

@theodorsm theodorsm marked this pull request as draft October 7, 2025 18:17
@JoeTurki
Copy link
Member

JoeTurki commented Oct 8, 2025

I'm just concerned that if we expose a public APIs, it'll be extremely difficult to change or remove it later, just my personal take about the dtls 1.3 suffix, maybe a sub package? what do you think?

@theodorsm
Copy link
Member Author

@JoeTurki thanks!

I agree that we should keep the API private until the DTLS 1.3 implementation is ready; we should only make it public as the last thing to do. If that is what you meant by it?

Regarding the sub-package or suffix: It depends. Using a sub-package I am afraid to loose access to some private fields in structs or functions that can be valuable for the implementation. Using a suffix, we can move fast without those problems, but it will be a bit messy file-wise (especially with flights). Will definitely have another look to see what's possible. I think a combination might be a good solution.

@JoeTurki
Copy link
Member

JoeTurki commented Oct 8, 2025

I agree that we should keep the API private until the DTLS 1.3 implementation is ready; we should only make it public as the last thing to do. If that is what you meant by it?

Yeah this will be a good call, private or sub package, but private will be better, I agree , for example: if we expose NewConfigVersion13 we'll not be able to remove it in the future :(

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 35.71429% with 234 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.93%. Comparing base (7b68bd9) to head (54da2ab).

Files with missing lines Patch % Lines
handshaker_13.go 26.40% 129 Missing and 2 partials ⚠️
conn.go 54.13% 55 Missing and 6 partials ⚠️
flight_13.go 14.28% 36 Missing ⚠️
config.go 42.85% 3 Missing and 1 partial ⚠️
flighthandler_13.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #738      +/-   ##
==========================================
- Coverage   79.13%   76.93%   -2.21%     
==========================================
  Files         102      105       +3     
  Lines        6917     7271     +354     
==========================================
+ Hits         5474     5594     +120     
- Misses       1068     1293     +225     
- Partials      375      384       +9     
Flag Coverage Δ
go 76.95% <35.71%> (-2.21%) ⬇️
wasm 57.09% <35.43%> (-1.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DTLS 1.3 config flag

2 participants