Skip to content
Commits on Source (8)
Release 4.5.6
-------------------
This is a maintenance release that adds Automatic-Module-Name to the manifest for compatibility
with Java 9 Platform Module System and fixes a number of issues discovered since 4.5.5
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Changelog:
-------------------
* [HTTPCLIENT-1882=: reset authentication state on I/O or runtime error for connection based
authentication schemes (such as NTLM)
Contributed by Oleg Kalnichevski <olegk at apache.org>
* [HTTPCLIENT-1924]: HttpClient to shut down the connection manager if a fatal error occurs
in the course of a request execution.
Contributed by Oleg Kalnichevski <olegk at apache.org>
* Add Automatic-Module-Name in manifest so Java9 modular applications can depend on this library
Contributed by Varun Nandi <varunkn at amazon.com>
* [HTTPCLIENT-1923]: fixed incorrect connection close on shutdown + fixed corresponding test
Contributed by Aleksei Arsenev <aarseniev at yandex-team.ru>
* [HTTPCLIENT-1906]: certificates containing alternative subject names other than DNS and IP
(such as RFC822) get rejected as invalid
Contributed by Oleg Kalnichevski <olegk at apache.org>
* [HTTPCLIENT-1904]: check cookie domain for null
Contributed by Hans-Peter Keck <hans-peter.keck at haufe-lexware.com>
* [HTTPCLIENT-1900]: proxy protocol processor does not post-process CONNECT response messages
Contributed by Oleg Kalnichevski <olegk at apache.org>
* [HTTPCLIENT-1911]: Failing tests on Fedora 28 due to weak encryption algorithms in test
keystore.
Contributed by Gary Gregory <ggregory at apache.org> and Michael Simacek <msimacek at redhat dot com>
Release 4.5.5
-------------------
......
httpcomponents-client (4.5.6-1) unstable; urgency=medium
* Team upload.
* New upstream release
- Refreshed the patches
* Standards-Version updated to 4.2.0
* Use salsa.debian.org Vcs-* URLs
* Use a secure URL in debian/watch
-- Emmanuel Bourg <ebourg@apache.org> Mon, 06 Aug 2018 15:12:53 +0200
httpcomponents-client (4.5.5-1) unstable; urgency=medium
* Team upload.
......
......@@ -19,9 +19,9 @@ Build-Depends-Indep:
libmaven-bundle-plugin-java,
libmaven-javadoc-plugin-java,
libmockito-java
Standards-Version: 4.1.3
Vcs-Git: https://anonscm.debian.org/git/pkg-java/httpcomponents-client.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/httpcomponents-client.git
Standards-Version: 4.2.0
Vcs-Git: https://salsa.debian.org/java-team/httpcomponents-client.git
Vcs-Browser: https://salsa.debian.org/java-team/httpcomponents-client
Homepage: http://hc.apache.org/httpcomponents-client-ga/index.html
Package: libhttpclient-java
......
......@@ -3,38 +3,37 @@ Date: Wed, 28 Mar 2012 22:20:33 +0200
Subject: generate-osgi-metadata
---
httpclient/pom.xml | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
httpclient/pom.xml | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/httpclient/pom.xml b/httpclient/pom.xml
index 32c5cb4..e076406 100644
--- a/httpclient/pom.xml
+++ b/httpclient/pom.xml
@@ -117,13 +117,38 @@
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
@@ -127,6 +127,7 @@
</goals>
<configuration>
<archive combine.children="append">
+ <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
<manifestEntries>
<Automatic-Module-Name>org.apache.httpcomponents.httpclient</Automatic-Module-Name>
</manifestEntries>
@@ -135,6 +136,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>2.3.7</version>
+ <extensions>true</extensions>
<executions>
<execution>
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
<goals>
- <goal>test-jar</goal>
+ <goals>
+ <goal>manifest</goal>
</goals>
</execution>
</executions>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <instructions>
+ <Bundle-Name>Apache ${project.name}</Bundle-Name>
......@@ -47,6 +46,7 @@ index 32c5cb4..e076406 100644
+ <_removeheaders>JAVA_1_3_HOME,JAVA_1_4_HOME</_removeheaders>
+ </instructions>
+ </configuration>
</plugin>
+ </plugin>
</plugins>
</build>
Description: Ensures the suffix list file is included in the jar
Author: Emmanuel Bourg <ebourg@pache.org>
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/httpclient/pom.xml
+++ b/httpclient/pom.xml
......
......@@ -2,6 +2,3 @@
%:
dh $@ --with javahelper
get-orig-source:
uscan --download-current-version --force-download --no-symlink
version=3
http://www.apache.org/dist/httpcomponents/httpclient/source/httpcomponents-client-(\d+[^a-zA-Z]*)-src\.tar\.gz debian debian/orig-tar.sh
https://www.apache.org/dist/httpcomponents/httpclient/source/httpcomponents-client-(\d+[^a-zA-Z]*)-src\.tar\.gz debian debian/orig-tar.sh
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-client</artifactId>
<version>4.5.5</version>
<version>4.5.6</version>
</parent>
<artifactId>fluent-hc</artifactId>
<name>Apache HttpClient Fluent API</name>
......@@ -81,6 +81,28 @@
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive combine.children="append">
<manifestEntries>
<Automatic-Module-Name>org.apache.httpcomponents.fluent-hc</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
......
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-client</artifactId>
<version>4.5.5</version>
<version>4.5.6</version>
</parent>
<artifactId>httpclient-cache</artifactId>
<name>Apache HttpClient Cache</name>
......@@ -133,9 +133,19 @@
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
<configuration>
<archive combine.children="append">
<manifestEntries>
<Automatic-Module-Name>org.apache.httpcomponents.httpclient-cache</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
......
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-client</artifactId>
<version>4.5.5</version>
<version>4.5.6</version>
</parent>
<artifactId>httpclient-osgi</artifactId>
<name>Apache HttpClient OSGi bundle</name>
......
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-client</artifactId>
<version>4.5.5</version>
<version>4.5.6</version>
</parent>
<artifactId>httpclient-win</artifactId>
<name>Apache HttpClient Windows features</name>
......@@ -69,6 +69,31 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive combine.children="append">
<manifestEntries>
<Automatic-Module-Name>org.apache.httpcomponents.httpclient-win</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
......
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-client</artifactId>
<version>4.5.5</version>
<version>4.5.6</version>
</parent>
<artifactId>httpclient</artifactId>
<name>Apache HttpClient</name>
......@@ -119,9 +119,19 @@
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
<configuration>
<archive combine.children="append">
<manifestEntries>
<Automatic-Module-Name>org.apache.httpcomponents.httpclient</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
......
......@@ -133,6 +133,15 @@ public class AuthState {
return this.authOptions != null && !this.authOptions.isEmpty();
}
/**
* Returns {@code true} if the actual authentication scheme is connection based.
*
* @since 4.5.6
*/
public boolean isConnectionBased() {
return this.authScheme != null && this.authScheme.isConnectionBased();
}
/**
* Updates the auth state with a queue of {@link AuthOption}s.
*
......
......@@ -305,14 +305,16 @@ public final class DefaultHostnameVerifier implements HostnameVerifier {
for (final List<?> entry : entries) {
final Integer type = entry.size() >= 2 ? (Integer) entry.get(0) : null;
if (type != null) {
if (type == SubjectName.DNS || type == SubjectName.IP) {
final Object o = entry.get(1);
if (o instanceof String) {
result.add(new SubjectName((String) o, type.intValue()));
result.add(new SubjectName((String) o, type));
} else if (o instanceof byte[]) {
// TODO ASN.1 DER encoded form
}
}
}
}
return result;
} catch (final CertificateParsingException ignore) {
return Collections.emptyList();
......
......@@ -157,7 +157,9 @@ public class BasicHttpClientConnectionManager implements HttpClientConnectionMan
@Override
public void close() {
shutdown();
if (this.isShutdown.compareAndSet(false, true)) {
closeConnection();
}
}
HttpRoute getRoute() {
......@@ -206,7 +208,7 @@ public class BasicHttpClientConnectionManager implements HttpClientConnectionMan
};
}
private void closeConnection() {
private synchronized void closeConnection() {
if (this.conn != null) {
this.log.debug("Closing connection");
try {
......@@ -220,20 +222,6 @@ public class BasicHttpClientConnectionManager implements HttpClientConnectionMan
}
}
private void shutdownConnection() {
if (this.conn != null) {
this.log.debug("Shutting down connection");
try {
this.conn.shutdown();
} catch (final IOException iox) {
if (this.log.isDebugEnabled()) {
this.log.debug("I/O exception shutting down connection", iox);
}
}
this.conn = null;
}
}
private void checkExpiry() {
if (this.conn != null && System.currentTimeMillis() >= this.expiry) {
if (this.log.isDebugEnabled()) {
......@@ -373,10 +361,8 @@ public class BasicHttpClientConnectionManager implements HttpClientConnectionMan
}
@Override
public synchronized void shutdown() {
if (this.isShutdown.compareAndSet(false, true)) {
shutdownConnection();
}
public void shutdown() {
close();
}
}
......@@ -90,6 +90,9 @@ public class PublicSuffixDomainFilter implements CommonCookieAttributeHandler {
@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
final String host = cookie.getDomain();
if (host == null) {
return false;
}
final int i = host.indexOf('.');
if (i >= 0) {
final String domain = host.substring(i);
......
......@@ -299,14 +299,12 @@ public class MainClientExec implements ClientExecChain {
} else {
managedConn.close();
if (proxyAuthState.getState() == AuthProtocolState.SUCCESS
&& proxyAuthState.getAuthScheme() != null
&& proxyAuthState.getAuthScheme().isConnectionBased()) {
&& proxyAuthState.isConnectionBased()) {
this.log.debug("Resetting proxy auth state");
proxyAuthState.reset();
}
if (targetAuthState.getState() == AuthProtocolState.SUCCESS
&& targetAuthState.getAuthScheme() != null
&& targetAuthState.getAuthScheme().isConnectionBased()) {
&& targetAuthState.isConnectionBased()) {
this.log.debug("Resetting target auth state");
targetAuthState.reset();
}
......@@ -351,10 +349,25 @@ public class MainClientExec implements ClientExecChain {
throw ex;
} catch (final IOException ex) {
connHolder.abortConnection();
if (proxyAuthState.isConnectionBased()) {
proxyAuthState.reset();
}
if (targetAuthState.isConnectionBased()) {
targetAuthState.reset();
}
throw ex;
} catch (final RuntimeException ex) {
connHolder.abortConnection();
if (proxyAuthState.isConnectionBased()) {
proxyAuthState.reset();
}
if (targetAuthState.isConnectionBased()) {
targetAuthState.reset();
}
throw ex;
} catch (final Error error) {
connManager.shutdown();
throw error;
}
}
......@@ -471,6 +484,7 @@ public class MainClientExec implements ClientExecChain {
this.authenticator.generateAuthResponse(connect, proxyAuthState, context);
response = this.requestExecutor.execute(connect, managedConn, context);
this.requestExecutor.postProcess(response, this.proxyHttpProcessor, context);
final int status = response.getStatusLine().getStatusCode();
if (status < 200) {
......