Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve proxy auth issue #104

Merged
merged 1 commit into from
Dec 3, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public List<EpssItem> download() {
List<EpssItem> list = null;
HttpGet request = new HttpGet(downloadUrl);
SystemDefaultRoutePlanner planner = new SystemDefaultRoutePlanner(ProxySelector.getDefault());
try (CloseableHttpClient client = HttpClientBuilder.create().setRoutePlanner(planner).build()) {
try (CloseableHttpClient client = HttpClientBuilder.create().setRoutePlanner(planner).useSystemProperties()
.build()) {
list = client.execute(request, new EpssResponseHandler());
} catch (IOException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public GitHubSecurityAdvisoryClient(String githubToken, String endpoint) {
cwesTemplate = loadMustacheTemplate(CWES_TEMPLATE);

SystemDefaultRoutePlanner planner = new SystemDefaultRoutePlanner(ProxySelector.getDefault());
httpClient = HttpAsyncClients.custom().setRoutePlanner(planner).build();
httpClient = HttpAsyncClients.custom().setRoutePlanner(planner).useSystemProperties().build();
httpClient.start();
objectMapper = new ObjectMapper();
objectMapper.registerModule(new JavaTimeModule());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public KevCatalog download() {
HttpGet request = new HttpGet(downloadUrl);
SystemDefaultRoutePlanner planner = new SystemDefaultRoutePlanner(ProxySelector.getDefault());
String json;
try (CloseableHttpClient client = HttpClientBuilder.create().setRoutePlanner(planner).build()) {
try (CloseableHttpClient client = HttpClientBuilder.create().setRoutePlanner(planner).useSystemProperties()
.build()) {
json = client.execute(request, new BasicHttpClientResponseHandler());
} catch (IOException e) {
throw new KevException("Unable to download the Known Exploitable Vulnerability Catalog", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ class RateLimitedClient implements AutoCloseable {
LOG.debug("rate limited call delay: {}", delay);
NvdApiRetryStrategy retryStrategy = new NvdApiRetryStrategy(maxRetries, minimumDelay);
SystemDefaultRoutePlanner planner = new SystemDefaultRoutePlanner(ProxySelector.getDefault());
client = HttpAsyncClients.custom().setRoutePlanner(planner).setRetryStrategy(retryStrategy).build();
client = HttpAsyncClients.custom().setRoutePlanner(planner).setRetryStrategy(retryStrategy)
.useSystemProperties().build();
client.start();
}

Expand Down
Loading