Fixes an issue where tlsx could hang indefinitely during large scans with cipher enumeration enabled.
Root Cause
During large scans some targets accept a TCP connection but never complete the TLS handshake. In this situation the TLS handshake call can block indefinitely.
Additionally, several parts of the scanning pipeline used context.Background() for connection pool acquisition and network operations. Under high concurrency this allowed workers to block without any timeout, eventually causing the scan to stall after processing thousands of targets.
Cipher enumeration also performed TLS handshakes sequentially, which increased the likelihood of worker starvation when multiple slow or unresponsive hosts were encountered.
Fix
This PR ensures that all potentially blocking operations respect timeouts and cannot stall workers:
Testing
Environment:
Arch Linux
Go 1.26
Test setup:
Before fix: tlsx consistently stalled around ~25k targets and the JSON output file ended with a truncated line.
After fix:
The scan completes successfully with all results written and no deadlock observed.
JSONL output is valid and complete.
Proof: 30k targets processed successfully in 2min 31 sec
/claim #819
BISHT.cx
@cherry-bisht
youssefosama3820009-commits
@youssefosama3820009-commits
ProjectDiscovery
@projectdiscovery