char * vortex_tls_get_peer_ssl_digest ( VortexConnection connection,
VortexDigestMethod  method 

Allows to return the certificate digest from the remote peer given TLS session is activated (this is also called the certificate fingerprint).

connectionThe connection where a TLS session was activated, and a message digest is required using as input the certificate provided by the remote peer.
methodThis is the digest method to use.
A newly allocated fingerprint or NULL if it fails. If NULL is returned there is a TLS error (certificate not provided) or the system is out of memory.

About getting a digest that matches this function's result

This function returns the digest of X509_digest's result from the certificate. That way, the value reported by this function will not match the value reported by calling to openssl over the certificate used:

1 >> openssl x509 -noout -in test-certificate.pem -fingerprint -md5

If you want to get the digest that matches this function out of the file, use the tool and example provided for that: vortex-digest-tool

Source code for this tool is located at:

To get the digest, it will be:

1 > ./vortex-digest-tool -v -md5 ../test/test-certificate.pem
2 INFO: using certificate ../test/test-certificate.pem as source
3 57:16:98:1B:71:F5:D3:6A:52:9F:74:F1:29:2E:D2:86

References VORTEX_MD5, VORTEX_SHA1, and vortex_tls_get_ssl_object().