diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AwsRequestSignerV4.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AwsRequestSignerV4.java index ab3013762..cf4420fe5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AwsRequestSignerV4.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AwsRequestSignerV4.java @@ -10,6 +10,8 @@ package org.eclipse.jgit.transport; +import static java.nio.charset.StandardCharsets.UTF_8; + import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; @@ -145,7 +147,7 @@ public static void sign(HttpURLConnection httpURLConnection, canonicalRequest.getBytes(StandardCharsets.UTF_8))); // compute the signing key - byte[] secretKey = (SCHEME + new String(awsSecretKey)).getBytes(); + byte[] secretKey = (SCHEME + new String(awsSecretKey)).getBytes(UTF_8); byte[] dateKey = signStringWithKey(scopeDate, secretKey); byte[] regionKey = signStringWithKey(regionName, dateKey); byte[] serviceKey = signStringWithKey(serviceName, regionKey);