It would have been a great opportunity to use BearSSL[0].
0. https://bearssl.org/
0. https://bearssl.org/gitweb/?p=BearSSL;a=summary