Skip to content

Commit

Permalink
Updated to HttpClient 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Jan 21, 2025
1 parent c64ca2e commit e058d87
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
10 changes: 10 additions & 0 deletions as2-demo-spring-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
<distribution>repo</distribution>
</license>
</licenses>

<properties>
<junit.jupiter.version>5.11.4</junit.jupiter.version>
</properties>

<dependencies>
<dependency>
Expand Down Expand Up @@ -69,6 +73,12 @@
<version>${spring-boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
import org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy;
import org.apache.hc.client5.http.ssl.TlsSocketStrategy;
import org.apache.hc.core5.http.ClassicHttpRequest;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.Header;
Expand Down Expand Up @@ -120,9 +121,9 @@ public AS2HttpClient (@Nonnull @Nonempty final String sUrl,
final HttpClientBuilder aClientBuilder = HttpClientBuilder.create ().setDefaultRequestConfig (aRequestConf);
if (aSSLContext != null)
{
final SSLConnectionSocketFactory aSSLFactory = new SSLConnectionSocketFactory (aSSLContext, aHV);
final TlsSocketStrategy aTlsSocketFactory = new DefaultClientTlsStrategy (aSSLContext, aHV);
final PoolingHttpClientConnectionManager aConnMgr = PoolingHttpClientConnectionManagerBuilder.create ()
.setSSLSocketFactory (aSSLFactory)
.setTlsSocketStrategy (aTlsSocketFactory)
.build ();
aClientBuilder.setConnectionManager (aConnMgr);
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<dependency>
<groupId>com.helger.web</groupId>
<artifactId>ph-web-parent-pom</artifactId>
<version>10.1.9</version>
<version>10.1.10-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down

0 comments on commit e058d87

Please sign in to comment.