Skip to content

bump(deps): bump github.com/pion/dtls from v2.2.12 to v3.1.1#1406

Merged
kongfei605 merged 1 commit intoflashcatcloud:mainfrom
kongfei605:dtls_fix
Feb 24, 2026
Merged

bump(deps): bump github.com/pion/dtls from v2.2.12 to v3.1.1#1406
kongfei605 merged 1 commit intoflashcatcloud:mainfrom
kongfei605:dtls_fix

Conversation

@kongfei605
Copy link
Collaborator

@kongfei605 kongfei605 commented Feb 24, 2026

Copilot AI review requested due to automatic review settings February 24, 2026 07:26
@kongfei605 kongfei605 merged commit 567969a into flashcatcloud:main Feb 24, 2026
2 of 4 checks passed
@kongfei605 kongfei605 deleted the dtls_fix branch February 24, 2026 07:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the DTLS dependency to the v3 major version and adapts the x509_cert input’s DTLS/UDP certificate retrieval to the new API.

Changes:

  • Switch github.com/pion/dtls import from /v2 to /v3 and update the DTLS client call site.
  • Update UDP handling to resolve/dial using net.ResolveUDPAddr + net.DialUDP, and adjust how peer certificates are read from DTLS connection state.
  • Refresh Go module dependencies (go.mod/go.sum) to reflect the new DTLS/transports versions.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
inputs/x509_cert/x509_cert.go Migrates DTLS client usage to v3 API and updates UDP connection setup/cert extraction.
go.mod Bumps DTLS to v3 and updates related indirect dependencies (logging/transport); reclassifies go-sysinfo as direct.
go.sum Updates checksums to match the new DTLS/logging/transport versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +318 to 323
raddr, err := net.ResolveUDPAddr(u.Scheme, u.Host)
if err != nil {
return nil, nil, err
}
ipConn, err := net.DialUDP(u.Scheme, nil, raddr)
if err != nil {
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timeout parameter is no longer applied for the UDP/DTLS path: ResolveUDPAddr + DialUDP don’t enforce any timeout, which can cause the DTLS handshake/cert fetch to hang indefinitely. Apply the timeout by setting deadlines on ipConn (e.g., SetDeadline(time.Now().Add(timeout)) for the handshake), or use a net.Dialer{Timeout: timeout} approach and ensure the resulting conn is a *net.UDPConn for dtls.Client.

Copilot uses AI. Check for mistakes.
defer conn.Close()

rawCerts := conn.ConnectionState().PeerCertificates
state, _ := conn.ConnectionState()
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conn.ConnectionState() returns a second value that is being discarded. If that value indicates an error (or handshake not completed), the current code will silently proceed and likely return an empty cert chain with a nil error. Handle the second return value and propagate a failure so callers get a clear error when the DTLS connection state can’t be retrieved.

Suggested change
state, _ := conn.ConnectionState()
state, err := conn.ConnectionState()
if err != nil {
return nil, nil, err
}

Copilot uses AI. Check for mistakes.
github.com/opencontainers/selinux v1.13.0
github.com/percona/percona-toolkit v0.0.0-20211210121818-b2860eee3152
github.com/pion/dtls/v2 v2.2.12
github.com/pion/dtls/v3 v3.1.2
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title says the dependency is bumped to github.com/pion/dtls v3.1.1, but go.mod is requiring v3.1.2 (and go.sum matches v3.1.2). Please align the PR title (or the module version) so the metadata matches what’s actually being vendored.

Copilot uses AI. Check for mistakes.
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.

2 participants