I have to migrate this Spring Boot code to latest version. After Spring 6+ setReadTimeout is deprecated.

HttpComponentsClientHttpRequestFactory factory = new 
HttpComponentsClientHttpRequestFactory();
factory.setReadTimeout(20);
factory.setConnectTimeout(20);
factory.setConnectionRequestTimeout(20);
return new RestTemplate(factory);

According to the JavaDoc: https://www.javadoc.io/static/org.springframework/spring-web/6.0.8/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html#setReadTimeout(int)

I have to use setSoTimeout but I can’t find this method. What should the proper way to migrate this code?