Skip to content

Commit

Permalink
Use Java's Base64 instead of Jersey's.
Browse files Browse the repository at this point in the history
This is a partial backport of #6702.
  • Loading branch information
dimitarndimitrov committed May 17, 2021
1 parent d1ea2b0 commit 2ece698
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
import io.confluent.rest.RestConfig;
import java.io.IOException;
import java.net.URI;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Base64;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
Expand All @@ -48,7 +50,6 @@
import org.eclipse.jetty.websocket.api.annotations.WebSocket;
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.glassfish.jersey.internal.util.Base64;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand Down Expand Up @@ -185,7 +186,8 @@ private static Code extractStatusCode(final Throwable message) {
}

private static String buildBasicAuthHeader(final String userName, final String password) {
return Base64.encodeAsString(userName + ":" + password);
final String creds = userName + ":" + password;
return Base64.getEncoder().encodeToString(creds.getBytes(Charset.defaultCharset()));
}

private static String createJaasConfigContent() {
Expand Down

0 comments on commit 2ece698

Please sign in to comment.