File tree 1 file changed +10
-1
lines changed
oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,16 @@ public static final class JwkSetUriJwtDecoderBuilder {
272
272
273
273
private Set <SignatureAlgorithm > signatureAlgorithms = new HashSet <>();
274
274
275
- private RestOperations restOperations = new RestTemplate ();
275
+ private RestOperations restOperations = this .buildRestTemplateWithDefaultTimeoutValues ();
276
+
277
+ private RestTemplate buildRestTemplateWithDefaultTimeoutValues () {
278
+ int connectTimeout = Integer .parseInt (System .getProperty ("sun.net.client.defaultConnectTimeout" , "30000" ));
279
+ int readTimeout = Integer .parseInt (System .getProperty ("sun.net.client.defaultReadTimeout" , "30000" ));
280
+ SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory ();
281
+ requestFactory .setConnectTimeout (connectTimeout );
282
+ requestFactory .setReadTimeout (readTimeout );
283
+ return new RestTemplate (requestFactory );
284
+ }
276
285
277
286
private Cache cache ;
278
287
You can’t perform that action at this time.
0 commit comments