From 1ee3af8bbe8e86f9d778c2a1f32d7399673fa9c2 Mon Sep 17 00:00:00 2001 From: Christian Oeing Date: Mon, 2 Nov 2020 20:40:56 +0100 Subject: [PATCH] #14 Specify UTF_8 as charset to convert string to byte array Signed-off-by: Christian Oeing --- .../binding/boschshc/internal/devices/bridge/BoschSslUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschSslUtil.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschSslUtil.java index 8875149743687..37114f2b5dd51 100644 --- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschSslUtil.java +++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschSslUtil.java @@ -18,6 +18,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.math.BigInteger; +import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.security.GeneralSecurityException; import java.security.KeyPair; @@ -149,7 +150,7 @@ private KeyStore createKeyStore(String keystore, String keystorePassword) Security.addProvider(new BouncyCastleProvider()); Signature signer = Signature.getInstance("SHA256withRSA", "BC"); signer.initSign(keyPair.getPrivate()); - signer.update("Hello OpenHAB".getBytes()); + signer.update("Hello OpenHAB".getBytes(StandardCharsets.UTF_8)); signer.sign(); X509Certificate cert = generateClientCertificate(keyPair);