public static AwsSyncClientBuilder prepareSyncClientBuilder(final AwsSyncClientBuilder builder,
                                                                final AwsCredentialsProvider credentialsProvider,
                                                                final BaseAmazonWebServicesProperties props) {
        val proxyConfig = ProxyConfiguration.builder();
        if (StringUtils.isNotBlank(props.getProxyHost())) {
            proxyConfig.endpoint(FunctionUtils.doUnchecked(() -> new URI(props.getProxyHost())))
                .password(props.getProxyPassword())
                .username(props.getProxyUsername());
        }

        val httpClientBuilder = ApacheHttpClient.builder()
            .proxyConfiguration(proxyConfig.build());

        httpClientBuilder
            .useIdleConnectionReaper(props.isUseReaper())
            .socketTimeout(Beans.newDuration(props.getSocketTimeout()))
            .maxConnections(props.getMaxConnections())
            .connectionTimeout(Beans.newDuration(props.getConnectionTimeout()))
            .connectionAcquisitionTimeout(Beans.newDuration(props.getClientExecutionTimeout()));

        if (StringUtils.isNotBlank(props.getLocalAddress())) {
            LOGGER.trace("Creating DynamoDb client local address [{}]", props.getLocalAddress());
            httpClientBuilder.localAddress(FunctionUtils.doUnchecked(() -> InetAddress.getByName(props.getLocalAddress())));
        }

        val clientBuilder = builder.httpClientBuilder(httpClientBuilder);
        if (clientBuilder instanceof final AwsClientBuilder awsClientBuilder) {
            val overrideConfig = ClientOverrideConfiguration.builder()
                .retryPolicy(RetryMode.valueOf(props.getRetryMode()))
                .build();
            awsClientBuilder.overrideConfiguration(overrideConfig);
            awsClientBuilder.credentialsProvider(credentialsProvider);

            val region = props.getRegion();
            awsClientBuilder.region(StringUtils.isBlank(region) ? Region.AWS_GLOBAL : Region.of(region));

            val endpoint = props.getEndpoint();
            if (StringUtils.isNotBlank(endpoint)) {
                awsClientBuilder.endpointOverride(FunctionUtils.doUnchecked(() -> new URI(endpoint)));
            }
        }
        return builder;
    }
Build client configuration.

@param builder             the builder
@param credentialsProvider the credentials provider
@param props               the props
@return the aws sync client builder
support/cas-server-support-aws/src/main/java/org/apereo/cas/aws/AmazonClientConfigurationBuilder.java