Obtain SSL Fingerprint

I'm sending a REST API Post through to my webserver using HTTPS. For this I need to declare my SSL Footprint.

I'm doing this as per line 8 in the following code:

https://github.com/pantri/A-Bit-Pushy/blob/master/pb01_sketch/pb01b_httpsPost.ino

This is fine until the SSL Footprint periodically updates (which it did today). Is there any way to automate obtaining the certificate? I'm currently obtaining it through this website - https://www.grc.com/fingerprints.htm but presumably, I can obtain it similarly through similar methods in C?

That would defeat the entire point of using a fingerprint to check the server's authenticity.

Think about it: you check the server's fingerprint against the known fingerprint. If a hacker tries to fool you by redirecting you to a fake server, the fingerprint is no longer the same, so you know that you shouldn't trust the server.

If you first get the fingerprint, and then check the server's fingerprint, they will always match, even if security is compromised.

You should use a CA certificate instead, if the fingerprint of the server changes. https://github.com/esp8266/Arduino/.../examples/HTTPSRequestCACert/HTTPSRequestCACert.ino

Pieter

Thanks.

This seems a lot better way of doing it.

PieterP: That would defeat the entire point of using a fingerprint to check the server's authenticity.

This is what I need to do.

I want to connect to a devices private wifi network that it hosts and use its rest api however the api calls are https mandatory and the device has its own ssl cert.

Basically i just want to be able to talk to it and i dont care about the security but it enforces SSL. ideally I want to not have to upload its cert manually using the IDE either as I'd like to share the device I make with other users of this device which may have different certs.

Thanks