Skip to content

Commit

Permalink
GH-6: logging dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
barthanssens committed Sep 3, 2024
1 parent b4b1fab commit aee33f3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import jakarta.annotation.PostConstruct;
import java.io.IOException;
import java.net.ProxySelector;
import java.net.URI;

import java.nio.charset.StandardCharsets;
Expand All @@ -36,6 +37,7 @@
import org.apache.hc.client5.http.classic.methods.HttpPost;
import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.client5.http.impl.routing.SystemDefaultRoutePlanner;
import org.apache.hc.core5.http.ClassicHttpResponse;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.ParseException;
Expand Down Expand Up @@ -73,11 +75,12 @@ public class ETranslationClient {
@PostConstruct
private void buildHttpClient() {
HttpClientBuilder builder = HttpClientBuilder.create();

BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(user, pass.toCharArray());
credentialsProvider.setCredentials(new AuthScope(scope, 443), credentials);
builder.setDefaultCredentialsProvider(credentialsProvider);
builder.setRoutePlanner(new SystemDefaultRoutePlanner(ProxySelector.getDefault()));

this.client = builder.build();
}
Expand Down

0 comments on commit aee33f3

Please sign in to comment.