linux - 如何使用 Linux CLI 知道某些网站的 SSL 指纹?

标签 linux ssl openssl command-line-interface esp8266

我正在尝试更新(使用 esp8266 微 Controller ),使用 API 更新托管在 DigitalOcean 上的 DNS 记录。

如何使用 Linux CLI 获取 HTTPS 指纹,以用于我的代码?

最佳答案

如果您使用的是 ESP (arduino IDE) 库 WiFiClientSecure.h, 您需要为指纹声明“const”变量,如下所示:

const char* fingerprint = "9A 8E 2F 33 95 CA 72 4F 47 26 54 52 A4 E5 00 70 F0 BD ED 85";

所以无论如何,这些值可以通过运行命令获取

$ echo | openssl s_client -connect host.example.com:443 |& openssl x509 -fingerprint -noout

结果:

SHA1 Fingerprint=9A:8E:2F:33:95:CA:72:4F:47:26:54:52:A4:E5:00:70:F0:BD:ED:85

关于linux - 如何使用 Linux CLI 知道某些网站的 SSL 指纹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46290083/

相关文章:

php - 检查进程是否仍在运行?

android - CertPathValidatorException : Trust anchor for certification path not found

ssl - 如何显示网站证书的公钥

c++ - 如何在 C++ 中测试公钥/私钥对?

linux - 仅使用 bash/标准 Linux 命令去除字符串中的单引号和双引号

linux - Linux 上的屏幕截图

linux - 如何将核心文件与其关联的可执行文件捆绑在一起?

对 OpenSSL 非阻塞 I/O 感到困惑

PHP MySQL OpenSSL 警告

ruby-on-rails - OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed - rake 任务到外部 API