diff --git a/connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/persistence/JsonFieldsEncryptor.java b/connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/persistence/JsonFieldsEncryptor.java index a1d8a9ac4f..fc617f226e 100644 --- a/connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/persistence/JsonFieldsEncryptor.java +++ b/connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/persistence/JsonFieldsEncryptor.java @@ -87,7 +87,7 @@ public static JsonObject decrypt(final JsonObject jsonObject, final String point } static String replaceUriPassword(final String uriStringRepresentation, final String patchedPassword) { - final String userInfo = URI.create(uriStringRepresentation).getUserInfo(); + final String userInfo = URI.create(uriStringRepresentation).getRawUserInfo(); final String newUserInfo = userInfo.substring(0, userInfo.indexOf(":") + 1) + patchedPassword; final int startOfPwd = uriStringRepresentation.indexOf(userInfo); final int endOfPassword = uriStringRepresentation.indexOf("@"); @@ -159,7 +159,7 @@ private static Optional getUriPassword(final String uriStringRepresentat .message("Not a valid connection URI") .build(); } - final String userInfo = uri.getUserInfo(); + final String userInfo = uri.getRawUserInfo(); if (userInfo == null) { return Optional.empty(); }