-
-
Notifications
You must be signed in to change notification settings - Fork 326
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
RemoteJWKSetOptions timeout not working #277
Labels
bug
Something isn't working
Comments
@bondyr thank you for the issue description, this is a helpful find! |
@panva Do you have any rough estimate when it might get fixed? |
@bondyr When I have the time to look into it myself or someone swoops in and magically offers their time and energy. j/k of course free open source gets fixed ASAP. |
panva
added a commit
that referenced
this issue
Oct 6, 2021
panva
added a commit
that referenced
this issue
Oct 6, 2021
It was damn fast magic, thanks a lot! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What happened?
What happens:
When
jwtVerify
is called with a function created bycreateRemoteJWKSet
as an argument, and server is irresponsive, there's no timeout. Request keeps hanging until server shuts down the connection.What is expected:
Request times out after
RemoteJWKSetOptions.timeoutDuration
period and exception is thrown.Other:
The issue happens for both default and specified manually value of
RemoteJWKSetOptions.timeoutDuration
Why:
It seems that
timeout
event is emitted byClientRequest
, but there's no listener function added so it's ignored infetch_jwks.js
Where:
Browser version seems to be working fine (I haven't tested it though, just telling by code analysis)
jose/dist/browser/runtime/fetch_jwks.js
Fix proposal:
In
jose/dist/node/cjs/runtime/fetch_jwks.js
andjose/dist/node/esm/runtime/fetch_jwks.js
files:Version
3.14.3, 3.19.0
Runtime
Node.js
Runtime Details
node v14.15.4, Win10 + WSL2
Code to reproduce
The text was updated successfully, but these errors were encountered: