Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: extra TLS data #210

Merged
merged 3 commits into from
Apr 27, 2024
Merged

feat: extra TLS data #210

merged 3 commits into from
Apr 27, 2024

Conversation

alexey-yarmosh
Copy link
Member

@@ -391,6 +401,11 @@ export class HttpCommand implements CommandInterface<HttpOptions> {
...cert.subject,
alt: cert.subjectaltname,
},
serialNumber: cert.serialNumber.match(/.{2}/g)!.join(':'),
fingerprint256: cert.fingerprint256,
keyType: cert.asn1Curve || cert.nistCurve ? 'EC' : cert.modulus || cert.exponent ? 'RSA' : null,
Copy link
Member

@MartinKolarik MartinKolarik Apr 27, 2024

Choose a reason for hiding this comment

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

@alexey-yarmosh just fyi, getX509Certificate() is indeed for server certificates, but there's also getPeerX509Certificate() which does work for our case. But it returns some other fields in a form that we would have to additionally parse, so I decided to keep your approach. RSA and EC are the only two types we should encounter on the web so it should be fine.

@MartinKolarik
Copy link
Member

I removed sha1 and sha512 fingerprints as they all do the same thing, and:

  • sha256 seems to be used by just about every tool I checked
  • sha1 is additionally used by some tools
  • sha512 doesn't seem to be used at all

We can add later if needed, but just one of these should be enough. On the other hand, I added the certificate fingerprint and key size fields.

@MartinKolarik MartinKolarik merged commit 06e8c65 into master Apr 27, 2024
14 checks passed
@MartinKolarik MartinKolarik deleted the tls-data branch April 27, 2024 14:20
Copy link

🎉 This PR is included in version 0.30.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants