串口输出日志:
DEBUG,t:20.85,m:211.06,[HTTPS] connection to aliyun server ...
[D][HTTPClient.cpp:276] beginInternal(): host: iot-auth.cn-shanghai.aliyuncs.com port: 443 url: /auth/register/device
PS] POST...
DEBUG,t:20.86,m:210.86,ali device register:productKey=a1AyzHf9sXq&deviceName=7D12CFA4&random=20864&sign=208ADB5862D0FD3F5591BFB88A03FC6B6A08F6EBDC4423897691AA884D93B32D&signMethod=hmacsha256
[D][HTTPClient.cpp:1025] connect(): connected to iot-auth.cn-shanghai.aliyuncs.com:443
[E][ssl_client.cpp:33] handle_error(): SSL - Bad input parameters to function
[E][ssl_client.cpp:35] handle_error(): MbedTLS message code: -28928
[E][ssl_client.cpp:33] handle_error(): SSL - Bad input parameters to function
[E][ssl_client.cpp:35] handle_error(): MbedTLS message code: -28928
[E][ssl_client.cpp:33] handle_error(): SSL - Bad input parameters to function
[E][ssl_client.cpp:35] handle_error(): MbedTLS message code: -28928
[W][HTTPClient.cpp:1318] returnError(): error(-2): send header failed
[E][ssl_client.cpp:33] handle_error(): SSL - Bad input parameters to function
[E][ssl_client.cpp:35] handle_error(): MbedTLS message code: -28928
[D][HTTPClient.cpp:1320] returnError(): tcp stop
[HTTPS] POST... failed, error: send header failed
[E][ssl_client.cpp:33] handle_error(): SSL - Bad input parameters to function
[E][ssl_client.cpp:35] handle_error(): MbedTLS message code: -28928
代码片段:
WiFiClientSecure* _client = new WiFiClientSecure;
if (!_client)return false;
_client->setCACert(root_ca);
AliMqttAuth auth = Config.ali_mqtt;
HTTPClient _https;
sprintf(host, "https://iot-auth.%s.aliyuncs.com/auth/register/device", auth.region_id);
INFO.print_debug("[HTTPS] connection to aliyun server ...\r\n");
if (_https.begin(*_client, host)) { // HTTPS
INFO.print("[HTTPS] POST...\r\n");
prepare_data();
// start connection and send HTTP header
size_t len = strlen(post_data);
_https.addHeader("Content-Type", "application/x-www-form-urlencoded");
_https.addHeader("Content-Length", String(len));
int httpCode = _https.POST((uint8_t*)post_data, strlen(post_data));
ESP32采用SSL连接阿里云注服务器失败
Moderator: ESP_Bob
Return to “ESP IoT Solution 中文讨论版”
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 18 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.