This PR addresses the deadlock issue where tlsx would hang indefinitely during TLS handshakes despite a configured timeout, as reported in #819.

Changes:

  • Modified pkg/tlsx/tls/tls.go and pkg/tlsx/ztls/ztls.go to run the TLS handshake in a separate goroutine.
  • Implemented a select statement that listens on both the handshake result channel and the context’s Done channel.
  • This ensures that if the underlying handshake blocks or hangs, the execution flow can still respect the context timeout and return an error instead of hanging.

This fix is critical for large-scale scanning where hanging connections can significantly degrade performance and resource utilization.

Fixes #819 /claim #819

Summary by CodeRabbit

  • Bug Fixes
    • Improved timeout handling and resource management for TLS cipher enumeration and handshake operations.

Claim

Total prize pool $1,324
Total paid $0
Status Pending
Submitted March 13, 2026
Last updated March 13, 2026

Contributors

ON

OnxyDaemon

@OnxyDaemon

100%

Sponsors

YO

youssefosama3820009-commits

@youssefosama3820009-commits

$1,224
PR

ProjectDiscovery

@projectdiscovery

$100