- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我使用的是 Arduino 提供的库中的 BearSSL,即 WiFiSecureClient 类。我使用引用实现在简单的 Python 实现的服务器和作为客户端的 ESP8266 板之间获得安全的 TCP 连接。
我使用 OpenSSL 导出了 key 和证书,并使用它们来提供 Python 套接字 SSL 包装器。一切正常,可以交换消息,但是 WifiSecureClient 无法验证证书。这是节点的部分代码:
void handle() {
// Use WiFiClientSecure class to create TLS connection
WiFiClientSecure client;
client.allowSelfSignedCerts();
Serial.print("connecting to ");
Serial.println(host);
if (!client.connect(host, httpsPort)) {
Serial.println("connection failed");
return;
}
if (client.verify(fingerprint, host)) {
Serial.println("certificate matches");
} else {
Serial.println("certificate doesn't match");
}
client.print("Some Message");
Serial.println("request sent");
String line;
while (client.connected()) {
line = client.readStringUntil('\n');
}
Serial.println("reply was:");
Serial.println("==========");
Serial.println(line);
Serial.println("==========");
Serial.println("closing connection");
client.stop();
}
如前所述,我可以发送和接收消息(我不知道它们是加密的还是回退未加密的)但是步骤
if (client.verify(fingerprint, host)) {
Serial.println("certificate matches");
} else {
Serial.println("certificate doesn't match");
}
总是失败。指纹是使用 OpenSSL 作为 SHA1 key 导出的。我通过使用另一台 PC 连接到服务器、获取证书并重新计算其指纹来仔细检查了这一点。如果我尝试联系像 api.github.com 这样的公共(public)服务器(在示例中是默认的),代码就可以正常工作。如您所见,我已经通过调用 BearSSL 的适当 API 方法允许自签名证书。
有没有我遗漏的东西,例如我必须有一个完整的 key 扣或什么的吗?
提前致谢!
最佳答案
请注意,verify() 的“主机”参数必须与证书通用名称匹配(在您的情况下为 *.github.com 或 api.github.com):
测试:openssl s_client -connect api.github.com:443
输出:0 s:/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=*.github.com
关于ssl - 在 ESP8266 (Arduino IDE) 上使用 BearSSL 进行指纹验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50786364/
我正在寻找一个编辑器/IDE,它可以为不是专门为它构建的语言提供在编码时很好的功能(例如:能够点击到函数定义)。通过这些,我想到了为非常特定的目的而设计的语言,并且通常只被一个小社区使用。换句话说,那
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
有简单的解释性编程语言,实际上还有控制台 interpreter.exe。 需要按 F5 对语法进行着色、自动完成和执行。 (如果有可能进行“调试”——那就太棒了!) 我从来没有做过这样的事情。 有许
我只是想知道是否有任何可以在我的黑莓上运行的 IDE。我的旧 Palm 有 C 和 BASIC 翻译。 C 板上使用 Palm 的内置文本编辑器,但 BASIC 解释器内置了自己的简单编辑器。 黑莓或
我正在制作一个文件编辑器,并希望为我的用户提供一个不错的 IDE,可以在其中在浏览器上编辑他们的 html/css 文件。是否有任何编辑器与 TinyMCE 类似,但它不是一个所见即所得的编辑器,它更
是否有一个带有集成调试器的D IDE? 最佳答案 Descent可以使用调试器。不完全是您的要求,但是... 关于ide - 是否有一个带有集成调试器的D IDE?,我们在Stack Overflow
每个程序员都知道工具很重要,对于开发人员来说,没有比用于编码的 IDE 更重要的工具了。在过去的几年里,IDE-s 成为标准,在这个领域看到创新并不常见。您可以推荐哪些 IDE 具有创新性,它们引入了
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想改善这个问题吗?更新问题,以便将其作为on-topic
我目前正在学习Ironpython和热爱软件,但我希望从使用notepad ++和cmd.exe继续前进,并尝试使用果汁多一点的东西。 我最近了解到Iron python studio不支持Iron
我主要从事 Java 和 C/C++ 开发,但我开始做更多的 Web 开发(PHP、Rails)和 Eiffel(学习一门新语言总是好的)。 目前,我使用 Eclipse for Java、C/C++
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
是否有 280Atlas (280atlas.com)(免费/商业)的替代品? 其中哪些是成熟的? 最佳答案 您可以使用 nib2cib ,这几乎是相同的想法,但它使用界面构建器(xcode的一部分)
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
IDE 的目标是提高生产力。他们在这方面做得很好。重构、导航、内联文档、自动完成有助于极大地提高生产力。 但是:每个工具都是武器 .相同的 IDE 有助于生成块代码。一些 IDE 功能会导致产生不良代
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
我正在寻找一些功能强大的C / C ++编程环境。实际上,我唯一需要的就是强大的源导航+创建工具。免费或商业都无所谓。我更喜欢一些linux工具,但是它不一定是必需的linux应用。 我需要的是一种具
我刚开始学习 D。有人知 Prop 有自动格式化功能的 D IDE 吗? Eclipse 的 DDT 似乎除了语法高亮之外没有任何其他功能。 最佳答案 我相信,目前 MonoDevelop + Mon
我有兴趣为一个副项目构建一个新风格的 IDE。主要是为了取消类固醇IDE上的普通记事本。我正在为已经尝试过的或者你已经看到(或没有看到)看起来很酷并且在 IDE 中有用的东西寻找一些灵感。我可以解决的
我需要维护一些 VB6 应用程序,并且在涉及枚举名称时遇到了一个奇怪的问题。 VB6 中的 Intellisense 应该工作的方式是,如果我的变量名称被定义为,例如,Dim Abraxis as S
正如标题所说,我看到很多编辑将宏录制作为一项功能吹捧,但自己却找不到利用这些功能的方法。那你能用它做什么呢?您可以记录鼠标移动和/或击键的类型?对外面的人真的那么有帮助吗?具体来说,我处理的 Ecli
我是一名优秀的程序员,十分优秀!