This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC3220SF:从文档复制粘贴片段后 HTTP 服务器不再响应

Guru**** 1135610 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/1234201/cc3220sf-http-server-not-responding-anymore-after-copy-pasting-snippet-from-documentation

器件型号:CC3220SF

您好!

以下是 sl_DeviceGet 中的器件报告:


芯片0x31000019
Mac 31.2.7.0.0
PHY 2.2.0.7
NWP 3.2.0.1.
ROM 0
主机3.0.1.71

我正在使用最新的服务包。 我上传了 TI 演示中的"配置"示例、并且可以通过 http 端口80连接到默认 IP 地址、并获取资源 index.html。

在复制粘贴以下代码后:  

unsigned char ServerCertificateFileName[] = "dummy-root-ca-cert";
unsigned char ServerKeyFileName[] = "dummy-root-ca-cert-key";
unsigned char SecurityMode[] = {0x1};
unsigned char HttpsPort[] = {0xBB, 0x01}; // 0x1BB = 443
unsigned char SecondaryPort[] = {0x50, 0x00}; // 0x050 = 80
unsigned char SecondaryPortEnable[] = {0x1};
// Set the file names used for TLS key exchange.
sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID,
 SL_NETAPP_HTTP_DEVICE_CERTIFICATE_FILENAME,
 sizeof(ServerCertificateFileName),
 ServerCertificateFileName);
 
 sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID,
 SL_NETAPP_HTTP_PRIVATE_KEY_FILENAME,
 sizeof(ServerKeyFileName),
 ServerKeyFileName);
 
// Activate TLS security on primary HTTP port and change it to
// 443 (standard HTTPS port)

sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID,
 SL_NETAPP_HTTP_PRIMARY_PORT_SECURITY_MODE,
 sizeof(SecurityMode),
 SecurityMode);
 
sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID,
 SL_NETAPP_HTTP_PRIMARY_PORT_NUMBER,
 sizeof(HttpsPort),
 HttpsPort);
 
// Enable secondary HTTP port (can only be used for redirecting
// connections to the secure primary port).
sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID,
 SL_NETAPP_HTTP_SECONDARY_PORT_NUMBER,
 sizeof(SecondaryPort),
 SecondaryPort);
 
sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID,
 SL_NETAPP_HTTP_SECONDARY_PORT_ENABLE,
 sizeof(SecondaryPortEnable),
 SecondaryPortEnable);
 
// Restart HTTP server for new configuration to take effect.
sl_NetAppStop(SL_NETAPP_HTTP_SERVER_ID);
sl_NetAppStart(SL_NETAPP_HTTP_SERVER_ID);

为了尝试 TLS、不仅无法到达相同的 index.html 页面、而且即使重新加载了与之前相同的配置示例、http 服务器也看起来死机了(可能是由于加载代码片段后的持久存储器?)  从 Wireshark 应用中、当我尝试代码片段时、我可以看到它  

据我所知,浏览器(192.168.1.77)首先尝试端口80,然后它被正确地重定向到端口443。 但是、它会在 Client Hello 之后不久收到一个 FIN (简单链路是 IP 192.168.1.76、连接在网络192.168.1.0/24上)。 FIN 似乎是在确认517个字节后生成的。 这个 FIN 数据包是 TLS 握手的结果吗? 此外,FIN 包永远不会被浏览器确认,因为简单链接会不断重新传输它。
我能够使用 ping 命令到达 simple link。 可能是什么问题?

谢谢!