Skip to content

Commit e1d3690

Browse files
authored
Merge pull request #93 from xylo/issue-92
use http proxy if https.proxyHost and https.proxyPort are set
2 parents e997941 + a0d67e5 commit e1d3690

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Changelog for nextcloud api
22

33
## Version 14.1.0
4-
- 2025-10-22
4+
- 2025-10-23
5+
- Add HTTP proxy support (via system variables `https.proxyHost` and `https.proxyPort`)
56
- Add User properties: lastLogin, backend, language, locale, and subAdminGroups
67

78
## Version 14.0.0

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.aarboard.nextcloud</groupId>
55
<artifactId>nextcloud-api</artifactId>
6-
<version>14.0.1</version>
6+
<version>14.1.0</version>
77
<packaging>jar</packaging>
88
<properties>
99
<!-- compile time dependencies -->
@@ -381,7 +381,7 @@
381381
<configuration>
382382
<configuration>
383383
<skipTests>${skipTests}</skipTests>
384-
</configuration>
384+
</configuration>
385385
<systemProperties>
386386
<property>
387387
<name>nextcloud.api.test.servername</name>

src/main/java/org/aarboard/nextcloud/api/utils/ConnectorCommon.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,11 @@ public static CloseableHttpAsyncClient getInstance(ServerConfig serverConfig)
249249
} catch (KeyManagementException | NoSuchAlgorithmException
250250
| KeyStoreException e) {
251251
throw new IOException(e);
252-
}
253-
252+
}
253+
254+
} else if (System.getProperty("https.proxyHost") != null && System.getProperty("https.proxyPort") != null) {
255+
HttpHost proxy = new HttpHost(System.getProperty("https.proxyHost"), Integer.parseInt(System.getProperty("https.proxyPort")), "http");
256+
HTTPC_CLIENT = HttpAsyncClients.custom().setProxy(proxy).build();
254257
} else {
255258
HTTPC_CLIENT = HttpAsyncClients.createDefault();
256259
}

0 commit comments

Comments
 (0)