Skip to content

Commit

Permalink
Add SAN logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dgaley committed Apr 17, 2024
1 parent ec140fe commit 5697c60
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/GlobalSignCAProxy/GlobalSignCAProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@

using Newtonsoft.Json;

using Org.BouncyCastle.Crypto.Tls;

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web.Services.Configuration;

namespace Keyfactor.Extensions.AnyGateway.GlobalSign
{
Expand Down Expand Up @@ -82,7 +86,21 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe
{
Logger.Warn("Subject is missing a CN value. Using SAN domain lookup instead");
}
StringBuilder rawSanList = new StringBuilder();
rawSanList.Append("Raw SAN List:\n");
foreach (var sanType in san.Keys)
{
rawSanList.Append($"SAN Type: {sanType}. Values: ");
foreach (var indivSan in san[sanType])
{
rawSanList.Append($"{indivSan},");
}
rawSanList.Append('\n');
}
Logger.Trace(rawSanList.ToString());

var sanDict = new Dictionary<string, string[]>(san, StringComparer.OrdinalIgnoreCase);
Logger.Trace($"DNS SAN Count: {sanDict["dns"].Count()}");
if (commonName == null)
{
foreach (string dnsSan in sanDict["dns"])
Expand Down

0 comments on commit 5697c60

Please sign in to comment.