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: Add the ability to get the peer certificate of an SSL connection #5744

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

dirkx
Copy link
Contributor

@dirkx dirkx commented Oct 8, 2021

Summary

New feature: Add the ability to get the peer certificate of an SSL connectio. This is useful for IoT when the root/cert trust chain has a shorter lifecylce than the device itself. Includes example code.

It adds two methods to the WiFiClientSecure client:

  1. bool getFingerprintSHA256( uint8_t fingerprint_remote_sha256[32]) -- return true and the fingerprint (i.e. the SHA256 of the raw x509 as a DER - identical to what you see in for example your webbrowser). Or false on error.
  2. const mbedtls_x509_crt* getPeerCertificate(); -- return the actual X509 struct or NULL on error.

Impact

No impact; backwards compatible (only adds to the API)

…ful for IoT when the root/cert trust chain has a shorter lifecylce than the device itself. Includes example
@CLAassistant
Copy link

CLAassistant commented Oct 8, 2021

CLA assistant check
All committers have signed the CLA.

@dirkx dirkx changed the title Add the ability to get the peer certificate of an SSL connection feat: Add the ability to get the peer certificate of an SSL connection Oct 9, 2021
@me-no-dev me-no-dev merged commit 7a7bd37 into espressif:master Oct 11, 2021
@me-no-dev
Copy link
Member

Thanks @dirkx :) nice feature!

@dirkx
Copy link
Contributor Author

dirkx commented Oct 11, 2021

Thank you for the quick merge !

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

Successfully merging this pull request may close these issues.

3 participants