This PR fixes issue #819 where tlsx hangs indefinitely when processing large target lists (~25k+ hosts). The output gets cut mid-line (e.g., mid-JSON key) because the process hangs during a write operation.
Broken timeout in ztls handshake: The tlsHandshakeWithTimeout function ran the handshake inline in a select statement instead of a goroutine, making the timeout ineffective. The handshake would block forever for unresponsive servers.
Missing timeout contexts: Cipher enumeration in tls, ztls, and jarm packages used context.Background() or context.TODO() for pool.Acquire() calls, allowing indefinite blocking.
Context leak in openssl: Using defer cancel() inside a loop caused context leaks.
No periodic buffer flush: The file writer only flushed on close, so if the process hung, buffered data was lost.
Added timeout_test.go with tests that verify:
Before: Process hangs indefinitely, output truncated mid-line After: Operations time out gracefully, process completes
/claim #819
Bug Fixes
Tests
Erdogan Kervanli
@erdogan98
youssefosama3820009-commits
@youssefosama3820009-commits
ProjectDiscovery
@projectdiscovery