Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@
<artifactId>httpcore</artifactId>
<version>${httpcomponents.httpcore.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>${httpcomponents.client5.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.core5</groupId>
<artifactId>httpcore5</artifactId>
<version>${httpcomponents.core5.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
Expand Down
7 changes: 0 additions & 7 deletions http-clients/apache5-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.core5</groupId>
<artifactId>httpcore5</artifactId>
<version>5.3.4</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
Expand Down Expand Up @@ -110,11 +108,6 @@
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
@SdkPublicApi
public final class Apache5HttpClient implements SdkHttpClient {

public static final String CLIENT_NAME = "Apache5Preview";
private static final String CLIENT_NAME = "Apache5Preview";

private static final Logger log = Logger.loggerFor(Apache5HttpClient.class);
private static final HostnameVerifier DEFAULT_HOSTNAME_VERIFIER = new DefaultHostnameVerifier();
Expand Down Expand Up @@ -733,14 +733,10 @@ public PoolingHttpClientConnectionManager create(Apache5HttpClient.DefaultBuilde
// Skip TTL=0 to maintain backward compatibility (infinite in 4.x vs immediate expiration in 5.x)
builder.setConnectionTimeToLive(TimeValue.of(connectionTtl.toMillis(), TimeUnit.MILLISECONDS));
}
PoolingHttpClientConnectionManager cm = builder.build();


cm.setDefaultMaxPerRoute(standardOptions.get(SdkHttpConfigurationOption.MAX_CONNECTIONS));
cm.setMaxTotal(standardOptions.get(SdkHttpConfigurationOption.MAX_CONNECTIONS));
cm.setDefaultSocketConfig(buildSocketConfig(standardOptions));

return cm;
builder.setMaxConnPerRoute(standardOptions.get(SdkHttpConfigurationOption.MAX_CONNECTIONS));
builder.setMaxConnTotal(standardOptions.get(SdkHttpConfigurationOption.MAX_CONNECTIONS));
builder.setDefaultSocketConfig(buildSocketConfig(standardOptions));
return builder.build();
}

private SSLConnectionSocketFactory getPreferredSocketFactory(Apache5HttpClient.DefaultBuilder configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
}
]
},
{
"name": "org.apache.http.client.config.RequestConfig$Builder",
"methods": [
{
"name": "setNormalizeUri"
}
]
},
{
"name": "org.apache.commons.logging.LogFactory",
"allDeclaredConstructors": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.instanceOf;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static software.amazon.awssdk.utils.JavaSystemSetting.SSL_KEY_STORE;
import static software.amazon.awssdk.utils.JavaSystemSetting.SSL_KEY_STORE_PASSWORD;
import static software.amazon.awssdk.utils.JavaSystemSetting.SSL_KEY_STORE_TYPE;
Expand All @@ -37,8 +36,6 @@
import javax.net.ssl.SSLException;
import org.apache.hc.client5.http.socket.ConnectionSocketFactory;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
import org.apache.hc.core5.http.NoHttpResponseException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
Expand Down Expand Up @@ -126,9 +123,8 @@ public void canMakeHttpsRequestWhenKeyProviderConfigured() throws IOException {

@Test
public void requestFailsWhenKeyProviderNotConfigured() throws IOException {
thrown.expect(anyOf(instanceOf(NoHttpResponseException.class), instanceOf(SSLException.class), instanceOf(SocketException.class)));
client = Apache5HttpClient.builder().tlsKeyManagersProvider(NoneTlsKeyManagersProvider.getInstance()).build();
makeRequestWithHttpClient(client);
assertThatThrownBy(() -> makeRequestWithHttpClient(client)).isInstanceOfAny(SSLException.class, SocketException.class);
}

@Test
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@
<jre.version>1.8</jre.version>
<httpcomponents.httpclient.version>4.5.13</httpcomponents.httpclient.version>
<httpcomponents.httpcore.version>4.4.16</httpcomponents.httpcore.version>

<httpcomponents.client5.version>5.5</httpcomponents.client5.version>
<httpcomponents.core5.version>5.3.4</httpcomponents.core5.version>
<!-- Reactive Streams version -->
<reactive-streams.version>1.0.4</reactive-streams.version>

Expand Down