Skip to content

Commit

Permalink
Set 'useSystemProperties' on HttpClient builder
Browse files Browse the repository at this point in the history
Set the httpClientBuilder.useSystemProperties() so that users may set the proxy settings
via system properties eg

```
-Djava.net.useSystemProxies=true
-Dhttp.proxyHost=PROXY_HOST
-Dhttp.proxyPort=PROXY_PORT
-Dhttp.proxyUser=USERNAME
-Dhttp.proxyPassword=PASSWORD
```
  • Loading branch information
ljdelight committed Apr 2, 2023
1 parent 2f906ba commit 3a825db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgis11:
image: postgis/postgis:11-2.5
image: postgis/postgis:13-3.3
ports:
- 5432:5432
env:
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/maproulette/client/http/HttpResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ private InputStream response() throws MapRouletteException
final var target = new HttpHost(this.uri.getHost(), this.uri.getPort(),
this.uri.getScheme());
final var context = HttpClientContext.create();
final var clientBuilder = HttpClients.custom();
// Create a builder that supports reading from system properties so things like
// proxies can be used with -Dhttp.proxyHost, -Dhttp.proxyPort.
final var clientBuilder = HttpClients.custom().useSystemProperties();
if (this.creds != null)
{
final var credsProvider = new BasicCredentialsProvider();
Expand Down

0 comments on commit 3a825db

Please sign in to comment.