Skip to content

Commit 1564d81

Browse files
bhillkeyfactorKeyfactor
andauthored
Fix NullReferenceException in GetEnrollmentResult for null DCV email (#9)
* Fix NullReferenceException in GetEnrollmentResult for null DCV email The condition for adding DCV email entries to the cnames dictionary was inverted (string.IsNullOrEmpty instead of !string.IsNullOrEmpty), causing cnames.Add(null, null) and an ArgumentNullException on every enrollment where CSC returned a DcvDetail with email=null (typical for EMAIL DCV orders that have actionNeeded=N, and for CNAME-only DCV). Inverts the condition and adds a ContainsKey guard to mirror the existing CName branch. * Update generated docs --------- Co-authored-by: Keyfactor <keyfactor@keyfactor.github.io>
1 parent 261a82b commit 1564d81

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 align="center" style="border-bottom: none">
2-
CSCGlobal CA Gateway AnyCA Gateway REST Plugin
2+
CSCGlobal CAPlugin AnyCA Gateway REST Plugin
33
</h1>
44

55
<p align="center">
@@ -38,10 +38,10 @@ This integration allows for the Synchronization, Enrollment, and Revocation of c
3838

3939
## Compatibility
4040

41-
The CSCGlobal CA Gateway AnyCA Gateway REST plugin is compatible with the Keyfactor AnyCA Gateway REST 24.2.0 and later.
41+
The CSCGlobal CAPlugin AnyCA Gateway REST plugin is compatible with the Keyfactor AnyCA Gateway REST 24.2.0 and later.
4242

4343
## Support
44-
The CSCGlobal CA Gateway AnyCA Gateway REST plugin is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com.
44+
The CSCGlobal CAPlugin AnyCA Gateway REST plugin is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com.
4545

4646
> To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab.
4747
@@ -53,7 +53,7 @@ This integration is tested and confirmed as working for Anygateway REST 24.2 and
5353

5454
1. Install the AnyCA Gateway REST per the [official Keyfactor documentation](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/InstallIntroduction.htm).
5555

56-
2. On the server hosting the AnyCA Gateway REST, download and unzip the latest [CSCGlobal CA Gateway AnyCA Gateway REST plugin](https://github.com/Keyfactor/cscglobal-caplugin/releases/latest) from GitHub.
56+
2. On the server hosting the AnyCA Gateway REST, download and unzip the latest [CSCGlobal CAPlugin AnyCA Gateway REST plugin](https://github.com/Keyfactor/cscglobal-caplugin/releases/latest) from GitHub.
5757

5858
3. Copy the unzipped directory (usually called `net6.0` or `net8.0`) to the Extensions directory:
5959

@@ -64,11 +64,11 @@ This integration is tested and confirmed as working for Anygateway REST 24.2 and
6464
Program Files\Keyfactor\AnyCA Gateway\AnyGatewayREST\net8.0\Extensions
6565
```
6666

67-
> The directory containing the CSCGlobal CA Gateway AnyCA Gateway REST plugin DLLs (`net6.0` or `net8.0`) can be named anything, as long as it is unique within the `Extensions` directory.
67+
> The directory containing the CSCGlobal CAPlugin AnyCA Gateway REST plugin DLLs (`net6.0` or `net8.0`) can be named anything, as long as it is unique within the `Extensions` directory.
6868

6969
4. Restart the AnyCA Gateway REST service.
7070

71-
5. Navigate to the AnyCA Gateway REST portal and verify that the Gateway recognizes the CSCGlobal CA Gateway plugin by hovering over the ⓘ symbol to the right of the Gateway on the top left of the portal.
71+
5. Navigate to the AnyCA Gateway REST portal and verify that the Gateway recognizes the CSCGlobal CAPlugin plugin by hovering over the ⓘ symbol to the right of the Gateway on the top left of the portal.
7272

7373
## Configuration
7474

cscglobal-caplugin/RequestManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public EnrollmentResult
8080
cnames.Add(dcv.CName.Name, dcv.CName.Value);
8181
}
8282

83-
if (string.IsNullOrEmpty(dcv.Email))
83+
if (!string.IsNullOrEmpty(dcv.Email) && !cnames.ContainsKey(dcv.Email))
8484
{
8585
cnames.Add(dcv.Email, dcv.Email);
8686
}

0 commit comments

Comments
 (0)