79494028

Date: 2025-03-08 07:20:15
Score: 1.5
Natty:
Report link

RequestConfig comes from org.apache.httpcomponents.client5:httpclient5
So add that library and try.

HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(
    HttpClientBuilder.create()
        .setDefaultRequestConfig(
            RequestConfig.custom().setProtocolUpgradeEnabled(false).build()
        ).build()
    );

Use the above factory in RestTemplate builder

RestTemplate restTemplate = restTemplateBuilder.requestFactory(() -> factory).build();

More discussions about this issue in Istio forum - https://github.com/istio/istio/issues/53239

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Nirmal Balaji Packirisamy