Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/gh-14269' into gh-14269
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJovanovic13 committed Apr 17, 2024
2 parents 5adf0b6 + 4afa21c commit 35bcb37
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,16 @@ public static final class JwkSetUriJwtDecoderBuilder {

private Set<SignatureAlgorithm> signatureAlgorithms = new HashSet<>();

private RestOperations restOperations = new RestTemplate();
private RestOperations restOperations = this.buildRestTemplateWithDefaultTimeoutValues();

private RestTemplate buildRestTemplateWithDefaultTimeoutValues() {
int connectTimeout = Integer.parseInt(System.getProperty("sun.net.client.defaultConnectTimeout", "30000"));
int readTimeout = Integer.parseInt(System.getProperty("sun.net.client.defaultReadTimeout", "30000"));
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
requestFactory.setConnectTimeout(connectTimeout);
requestFactory.setReadTimeout(readTimeout);
return new RestTemplate(requestFactory);
}

private Cache cache;

Expand Down

0 comments on commit 35bcb37

Please sign in to comment.