Skip to content

Commit c58cc5e

Browse files
committed
More fixes.
1 parent 0ca63d8 commit c58cc5e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

globalsign-mssl-caplugin/GlobalSignCAPlugin.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ public void Initialize(IAnyCAPluginConfigProvider configProvider, ICertificateDa
3030
{
3131
Logger = LogHandler.GetClassLogger(GetType());
3232
Logger.MethodEntry();
33-
_enabled = (bool)configProvider.CAConnectionData["Enabled"];
34-
if (!_enabled)
33+
var enabledValue = configProvider.CAConnectionData["Enabled"];
34+
bool isEnabled = enabledValue is bool ? (bool)enabledValue : bool.Parse((string)enabledValue);
35+
if (!isEnabled)
3536
{
3637
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping config validation and MSSL Client creation...");
3738
Logger.MethodExit();
@@ -40,7 +41,7 @@ public void Initialize(IAnyCAPluginConfigProvider configProvider, ICertificateDa
4041
Config = new GlobalSignCAConfig
4142
{
4243
IsTest = bool.Parse((string)configProvider.CAConnectionData["TestAPI"]),
43-
Enabled = bool.Parse((string)configProvider.CAConnectionData["Enabled"]),
44+
Enabled = isEnabled,
4445
Password = (string)configProvider.CAConnectionData["GlobalSignPassword"],
4546
Username = (string)configProvider.CAConnectionData["GlobalSignUsername"],
4647
PickupDelay = int.Parse((string)configProvider.CAConnectionData["DelayTime"]),

0 commit comments

Comments
 (0)