Skip to content

feat(tls): add Options.TLSConfig and Options.ZTLSConfig - #590

Merged
dogancanbakir merged 4 commits into
projectdiscovery:mainfrom
TassioSales:feat/configurable-tls-alpn
Oct 22, 2026
Merged

dogancanbakir merged 4 commits into
projectdiscovery:mainfrom
TassioSales:feat/configurable-tls-alpn

Conversation

@TassioSales

@TassioSales TassioSales commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Refs #587

Adds Options.TLSConfig and Options.ZTLSConfig, used by DialTLS and DialZTLS in place of DefaultTLSConfig and DefaultZTLSConfig, so consumers can opt into a modern handshake. Configs passed to the WithConfig dials are used as given. The default stays as is.

…support

Fixes projectdiscovery#587

- Added WithModernTLS, ALPN, TLSMinVersion, and custom TLSConfig/ZTLSConfig options
- Introduced ModernTLSConfig with TLS 1.2+ and h2/http/1.1 ALPN defaults
- Preserved backward-compatible legacy defaults while allowing consumers to enforce modern TLS handshakes
- Added comprehensive unit tests in dialer_tls_test.go
@TassioSales
TassioSales force-pushed the feat/configurable-tls-alpn branch from ea886fb to 7d930e9 Compare October 21, 2026 00:34
@dogancanbakir

Copy link
Copy Markdown
Member

Thanks @TassioSales. I narrowed this to Options.TLSConfig and Options.ZTLSConfig, the configs of DialTLS and DialZTLS. The global ALPN and min version were also applied to configs passed to the WithConfig and impersonated dials (a TLS 1.2 only config could no longer connect), and an h2 default breaks http.Transport with a custom DialTLS. Callers can now opt into a modern config through TLSConfig.

@dogancanbakir dogancanbakir changed the title feat(tls): add configurable modern TLS, custom ALPN, and min version support feat(tls): add Options.TLSConfig and Options.ZTLSConfig Oct 22, 2026
@dogancanbakir
dogancanbakir merged commit 3e7d5a1 into projectdiscovery:main Oct 22, 2026
5 checks passed
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