Skip to content

Commit b869611

Browse files
Compatibility fix: Support encrypted and decrypted password at CloudServices.config for memcached and redis.
1 parent 3692a9d commit b869611

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

dotnet/src/dotnetframework/Providers/Cache/GxMemcached/GxMemcached.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Linq;
44
using System.Security;
55
using System.Text.Json;
6-
using System.Text.Json.Serialization;
76
using Enyim.Caching;
87
using Enyim.Caching.Configuration;
98
using Enyim.Caching.Memcached;
@@ -40,7 +39,11 @@ MemcachedClient InitCache()
4039
password = providerService.Properties.Get("CACHE_PROVIDER_PASSWORD");
4140
if (!string.IsNullOrEmpty(password))
4241
{
43-
password = CryptoImpl.Decrypt(password);
42+
string ret = string.Empty;
43+
if (CryptoImpl.Decrypt(ref ret, password))
44+
{
45+
password = ret;
46+
}
4447
}
4548
}
4649
}

dotnet/src/dotnetframework/Providers/Cache/GxRedis/GxRedis.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ public Redis()
4141
password = providerService.Properties.Get("CACHE_PROVIDER_PASSWORD");
4242
if (!string.IsNullOrEmpty(password))
4343
{
44-
password = CryptoImpl.Decrypt(password);
44+
string ret = string.Empty;
45+
if (CryptoImpl.Decrypt(ref ret, password))
46+
{
47+
password = ret;
48+
}
4549
}
4650

4751
if (string.IsNullOrEmpty(address))

0 commit comments

Comments
 (0)