Skip to content

Custom Timeout to the server request made by Client #136

Answered by dennisvang
ritishbhardwaj asked this question in Q&A
Discussion options

You must be logged in to vote

...
So i got the idea of why not we customize the timeout from the client side.
Can you tell whether i am right or not and if i am right can you tell me the way how to customize it and where to refer the code.

Hi @ritishbhardwaj

Python-tuf defines the tuf.ngclient.RequestsFetcher, which has a socket_timeout argument.

Tufup defines a subclass of RequestsFetcher, called AuthRequestsFetcher, but we do not expose this in the tufup client. This was intentional, to limit the complexity for tufup users.

Your best option would probably be to monkey-patch AuthRequestsFetcher (or RequestsFetcher) to override the default socket_timeout value.

Do note that this may have security implications, as di…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ritishbhardwaj
Comment options

Answer selected by ritishbhardwaj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants