Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy.sslServers race condition #288

Open
fopinappb opened this issue Apr 11, 2023 · 1 comment
Open

Proxy.sslServers race condition #288

fopinappb opened this issue Apr 11, 2023 · 1 comment

Comments

@fopinappb
Copy link

getHttpsServer(hostname, (err, port) => {

...
https server started for www.google.com on 54724
https server started for www.google.com on 54726
...

With concurrent requests to www.google.com this semaphore is but the asynchronous callback (that populates sslServers) is outside the lock/sem.

This results in 2+ sslServers created for the same hostname yet only the last is tracked in the dictionary. This also means only the last one is cleaned up upon Proxy.close() resulting in lingering handles...

@WGH-
Copy link

WGH- commented Nov 21, 2023

This can be kinda worked around with forceSNI: true which doesn't create extra HTTPS servers.

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

No branches or pull requests

2 participants