Skip to content

Commit

Permalink
Add lightweight info on server cert chain
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlaw1979 committed Jan 30, 2023
1 parent 5fda507 commit 6b23bbc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion FiddlerImportNetlog/FiddlerInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace FiddlerImportNetlog
{
[ProfferFormat("NetLog JSON",
"Chromium's JSON-based event log format (v1.3.4.3). See https://textslashplain.com/2020/01/17/capture-network-logs-from-edge-and-chrome/ for more info.",
"Chromium's JSON-based event log format (v1.3.4.4). See https://textslashplain.com/2020/01/17/capture-network-logs-from-edge-and-chrome/ for more info.",
// We handle import of JSON files, whether uncompressed, or compressed with ZIP or GZ. I'm not completely sure I remember the implications
// of declaring .gz here, nor why .zip isn't mentioned. Is this about the drag/drop import feature?
".json;.gz"
Expand Down
41 changes: 33 additions & 8 deletions FiddlerImportNetlog/Importer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -711,20 +711,45 @@ private void GenerateSocketListSession(Dictionary<int, List<Hashtable>> dictSock
{
StringBuilder sbCertsReceived = new StringBuilder();
ArrayList alCerts = htParams["certificates"] as ArrayList;
if (alCerts.Count < 1) continue;

// Try to promote the SubjectCN to the title of this node
Hashtable htParsedCerts = new Hashtable(alCerts.Count);
try
{
if (String.IsNullOrEmpty(sSubjectCNinFirstCert) && alCerts.Count > 0)
for (int i = 0; i < alCerts.Count; i++)
{
var FirstCert = new X509Certificate2();
string sCertInfo = alCerts[0] as string;
FirstCert.Import(Encoding.ASCII.GetBytes(sCertInfo));
sSubjectCNinFirstCert = (" - " + FirstCert.GetNameInfo(X509NameType.SimpleName, false)).ToLower();
var htThisCert = new Hashtable();
htParsedCerts.Add(i.ToString(), htThisCert);
var certItem = new X509Certificate2();

certItem.Import(Encoding.ASCII.GetBytes(alCerts[i] as string));

// Try to promote the SubjectCN to the title of this Socket.
if (String.IsNullOrEmpty(sSubjectCNinFirstCert))
{
sSubjectCNinFirstCert = (" - " + certItem.GetNameInfo(X509NameType.SimpleName, false)).ToLower();
}

htThisCert.Add("Parsed", new ArrayList
{
"Subject: " + certItem.GetNameInfo(X509NameType.SimpleName, false),
"Issuer: " + certItem.Issuer,
"Expires: " + certItem.NotAfter.ToString("yyyy-MM-dd")
});

htThisCert.Add("RAW", new ArrayList
{
alCerts[i]
});
}
htThisSocket.Add("Server Certificates", htParsedCerts);
}
catch { }
htThisSocket.Add("Server Certificates", alCerts);
catch (Exception ex)
{
FiddlerApplication.Log.LogString(ex.Message);
htThisSocket.Add("Server Certificates", alCerts);
}

continue;
}

Expand Down
5 changes: 4 additions & 1 deletion FiddlerImportNetlog/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[assembly: AssemblyCopyright("Copyright ©2023 Eric Lawrence")]
[assembly: System.Resources.NeutralResourcesLanguage("en-US")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.3.4.3")] // ALWAYS UPDATE THE VERSION in the [ProfferFormat] attribute in FiddlerInterface.cs to match!
[assembly: AssemblyVersion("1.3.4.4")] // ALWAYS UPDATE THE VERSION in the [ProfferFormat] attribute in FiddlerInterface.cs to match!
[assembly: Fiddler.RequiredVersion("4.6.0.0")]


Expand All @@ -20,6 +20,9 @@ HTTP_STREAM_JOB has a binding between the request and the socket. Hook them up s
--> source_dependency = 1701 (URL_REQUEST)
*/

// v1.3.4.4
// Add lightweight breakout of server certinfo

// v1.3.4.3
// Set oTimers' values for ClientBeginResponse, ClientDoneResponse, and ServerDoneResponse so Timeline view works better.

Expand Down

1 comment on commit 6b23bbc

@ericlaw1979
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #7

Please sign in to comment.