RSA - The public key operation failed - ISSUE

doyoon.kim
Posts: 4
Joined: Thu Jan 20, 2022 11:57 am

RSA - The public key operation failed - ISSUE

Postby doyoon.kim » Fri Jan 21, 2022 1:39 am

Hi Team

We are developing a device that uses the ESP32 wrover to collect values ​​through environmental sensors and send them to AWS.

Sending to AWS " [E][ssl_client.cpp:36] _handle_error(): [start_ssl_client():218]: (-17040) RSA - The public key operation failed : BIGNUM - Memory allocation failed " is an issue and ESP32 reboot is occurring.

Please share if you have a solution to the issue.

issue debug
  • [D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

    [V][WiFiClientSecure.cpp:127] connect(): PL_start_ssl_client with CA_cert
    [V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 58648
    [V][ssl_client.cpp:65] start_ssl_client(): Starting socket
    [V][ssl_client.cpp:79] start_ssl_client(): PL_WiFiGenericClass::hostByName2(host = g0me4ec8f5.execute-api.ap-northeast-2.amazonaws.com, srv = 1073555948)
    [V][ssl_client.cpp:106] start_ssl_client(): Seeding the random number generator
    [V][ssl_client.cpp:115] start_ssl_client(): Setting up the SSL/TLS structure...
    [ssl_client.cpp:129] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
    [V][ssl_client.cpp:199] start_ssl_client(): Setting hostname for TLS session...
    [V][ssl_client.cpp:214] start_ssl_client(): Performing the SSL/TLS handshake...
    [E][ssl_client.cpp:36] _handle_error(): [start_ssl_client():218]: (-17040) RSA - The public key operation failed : BIGNUM - Memory allocation failed
    [E][WiFiClientSecure.cpp:134] connect(): PL_start_ssl_client: _use_insecure = 1
    [E][WiFiClientSecure.cpp:137] connect(): start_ssl_client: -17040
    [V][ssl_client.cpp:267] stop_ssl_socket(): Cleaning SSL connection.
    [D][HTTPClient.cpp:1118] connect(): failed connect to g0me4ec8f5.execute-api.ap-northeast-2.amazonaws.com:443
    [W][HTTPClient.cpp:1417] returnError(): error(-1): connection refused
    [HTTP]https.POST() nResponseCode = -1 (T?), u32T = 161


normal debug
  • [D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

    [V][WiFiClientSecure.cpp:127] connect(): PL_start_ssl_client with CA_cert
    [V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 59296
    [V][ssl_client.cpp:65] start_ssl_client(): Starting socket
    [V][ssl_client.cpp:79] start_ssl_client(): PL_WiFiGenericClass::hostByName2(host = g0me4ec8f5.execute-api.ap-northeast-2.amazonaws.com, srv = 1073555948)
    [V][ssl_client.cpp:106] start_ssl_client(): Seeding the random number generator
    [V][ssl_client.cpp:115] start_ssl_client(): Setting up the SSL/TLS structure...
    [ssl_client.cpp:129] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
    [V][ssl_client.cpp:199] start_ssl_client(): Setting hostname for TLS session...
    [V][ssl_client.cpp:214] start_ssl_client(): Performing the SSL/TLS handshake...
    [V][ssl_client.cpp:235] start_ssl_client(): Verifying peer X.509 certificate...
    [V][ssl_client.cpp:244] start_ssl_client(): Certificate verified.
    [V][ssl_client.cpp:259] start_ssl_client(): Free internal heap after TLS 13880
    [E][WiFiClientSecure.cpp:134] connect(): PL_start_ssl_client: _use_insecure = 1
    [D][HTTPClient.cpp:1125] connect(): connected to g0me4ec8f5.execute-api.ap-northeast-2.amazonaws.com:443
    [V][ssl_client.cpp:297] send_ssl_data(): Writing HTTP request with 200 bytes...
    [V][ssl_client.cpp:297] send_ssl_data(): Writing HTTP request with 1724 bytes...
    [V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
    [V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Date: Thu, 20 Jan 2022 11:05:48 GMT'
    [V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Type: application/json'
    [V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Length: 0'
    [V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Connection: keep-alive'
    [V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amzn-RequestId: 565f8e73-6d3d-4aa9-8b79-c68eefba5ae9'
    [V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amz-apigw-id: MPdB4FhQIE0FryA='
    [V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'X-Amzn-Trace-Id: Root=1-61e9420a-68db2f69205470d8631fd945;Sampled=0'
    [V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: ''
    [D][HTTPClient.cpp:1257] handleHeaderResponse(): code: 200
    [D][HTTPClient.cpp:603] sendRequest(): sendRequest code=200

    [HTTP]https.POST() nResponseCode = 200 (), u32T = 5617


Thank you ~~

ESP_Sprite
Posts: 8926
Joined: Thu Nov 26, 2015 4:08 am

Re: RSA - The public key operation failed - ISSUE

Postby ESP_Sprite » Fri Jan 21, 2022 2:28 am

That's an error that seems pretty clear to me - you ran out of memory. Suggest you reduce the RAM usage of your sketch.

doyoon.kim
Posts: 4
Joined: Thu Jan 20, 2022 11:57 am

Re: RSA - The public key operation failed - ISSUE

Postby doyoon.kim » Fri Jan 21, 2022 5:16 am

Hi ESP_Sprite

This is a problem that occurs while operating normally. (more than 5 hours continuous time)

It is not a problem that occurs immediately after booting.

I found a similar issue while browsing the website, and couldn't find a solution there, so I raised the issue.

I need an answer that will solve the issue.

https://github.com/espressif/esp-idf/issues/222

Thank you

ESP_Sprite
Posts: 8926
Joined: Thu Nov 26, 2015 4:08 am

Re: RSA - The public key operation failed - ISSUE

Postby ESP_Sprite » Fri Jan 21, 2022 8:02 am

...so what are you trying to say? Both the Arduino stack as well as the MbedTLS stack are capable of doing dynamic memory allocation, there's no reason at all why you should see an error directly after startup.

If you think there is a memory leak, I'd suggest logging the output of xPortGetFreeHeapSize() periodically over those 5 hours, see if that goes down consistently.

doyoon.kim
Posts: 4
Joined: Thu Jan 20, 2022 11:57 am

Re: RSA - The public key operation failed - ISSUE

Postby doyoon.kim » Sun Jan 23, 2022 6:13 am

Hi ESP_Sprite

I conducted a data transfer test every 5 minutes to determine the cause of the problem.
As in the attached code source, I skipped verification of SSL
I need an answer to this part of why I am suddenly doing SSL authentication

Code: Select all

WiFiClientSecure *pClientSecure = new WiFiClientSecure;

   https.addHeader(F("Content-Type"), F("application/json"));
   if (https.begin(*pClientSecure, pAQ_SERVER) != true)
   {
      delete pClientSecure;
      pClientSecure = NULL;
      return -3;
   }

  pClientSecure->setInsecure(); //skip verification

   feedWatchDog(true);

   int nRst = https.POST(pData, u16Size);

   pClientSecure->flush();
   pClientSecure->clearWriteError();
If you look at the source code I provided you are skipping the security related stuff.


It is part of the overall log of the test results.

Code: Select all

<showSensorPacket()> stCount.u8SensorCount = 1
[20220121-114547:218] [APDS] 	      10 	       9 	      10 	      26 	       0
---------------------------------------------------------------------------------
[POST] Count = 0, Length = 1736
[V][HTTPClient.cpp:245] beginInternal(): url: https://g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com/device/data
[D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com port: 443 url: /device/data
[D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 61428
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
[V][ssl_client.cpp:257] start_ssl_client(): Free internal heap after TLS 16028
[D][HTTPClient.cpp:1125] connect():  connected to g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com:443
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 200 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 1736 bytes...
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Date: Fri, 21 Jan 2022 02:50:50 GMT'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Type: application/json'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Length: 1668'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Connection: keep-alive'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amzn-RequestId: 111e7f20-4c6b-4620-ab2c-8f1f864e2aec'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amz-apigw-id: MRndjHsTIE0FeOw='
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'X-Amzn-Trace-Id: Root=1-61ea1f88-11f0e9c32edc843423c9a09b;Sampled=0'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: ''
[D][HTTPClient.cpp:1257] handleHeaderResponse(): code: 200
[D][HTTPClient.cpp:1260] handleHeaderResponse(): size: 1668
[D][HTTPClient.cpp:603] sendRequest(): sendRequest code=200

[HTTP]https.POST() nResponseCode = 200 (), u32T = 3018
-------------------------------------
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:400] disconnect(): tcp is closed

<showSensorPacket()> stCount.u8SensorCount = 1
[20220121-115117:223] [APDS] 	      10 	      10 	      11 	      27 	       0
---------------------------------------------------------------------------------
[POST] Count = 0, Length = 1736
[V][HTTPClient.cpp:245] beginInternal(): url: https://g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com/device/data
[D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com port: 443 url: /device/data
[D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 61108
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
[V][ssl_client.cpp:257] start_ssl_client(): Free internal heap after TLS 14000
[D][HTTPClient.cpp:1125] connect():  connected to g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com:443
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 200 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 1736 bytes...
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Date: Fri, 21 Jan 2022 02:56:20 GMT'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Type: application/json'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Length: 1668'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Connection: keep-alive'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amzn-RequestId: 3c90e669-607a-4a5e-815e-142bfd72b1be'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amz-apigw-id: MRoRHERBIE0FnOg='
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'X-Amzn-Trace-Id: Root=1-61ea20d2-48ff15d5276501b37b980130;Sampled=0'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: ''
[D][HTTPClient.cpp:1257] handleHeaderResponse(): code: 200
[D][HTTPClient.cpp:1260] handleHeaderResponse(): size: 1668
[D][HTTPClient.cpp:603] sendRequest(): sendRequest code=200

[HTTP]https.POST() nResponseCode = 200 (), u32T = 3052
-------------------------------------
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:400] disconnect(): tcp is closed

<showSensorPacket()> stCount.u8SensorCount = 1
[20220121-115647:208] [APDS] 	      10 	      10 	      11 	      27 	       0
---------------------------------------------------------------------------------
[POST] Count = 0, Length = 1738
[V][HTTPClient.cpp:245] beginInternal(): url: https://g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com/device/data
[D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com port: 443 url: /device/data
[D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 60788
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
[V][ssl_client.cpp:257] start_ssl_client(): Free internal heap after TLS 15380
[D][HTTPClient.cpp:1125] connect():  connected to g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com:443
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 200 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 1738 bytes...
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Date: Fri, 21 Jan 2022 03:01:48 GMT'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Type: application/json'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Length: 1668'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Connection: keep-alive'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amzn-RequestId: 09d11f49-4539-4a24-8c7a-9f3c98eeff90'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amz-apigw-id: MRpEeGeroE0FeOw='
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'X-Amzn-Trace-Id: Root=1-61ea221c-0133a2132ad84adb27bd0700;Sampled=0'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: ''
[D][HTTPClient.cpp:1257] handleHeaderResponse(): code: 200
[D][HTTPClient.cpp:1260] handleHeaderResponse(): size: 1668
[D][HTTPClient.cpp:603] sendRequest(): sendRequest code=200

[HTTP]https.POST() nResponseCode = 200 (), u32T = 1655
-------------------------------------
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:400] disconnect(): tcp is closed

<showSensorPacket()> stCount.u8SensorCount = 1
[20220121-120217:209] [APDS] 	      10 	      10 	      11 	      28 	       0
---------------------------------------------------------------------------------
[POST] Count = 0, Length = 1737
[V][HTTPClient.cpp:245] beginInternal(): url: https://g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com/device/data
[D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com port: 443 url: /device/data
[D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 60468
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
[V][ssl_client.cpp:257] start_ssl_client(): Free internal heap after TLS 15068
[D][HTTPClient.cpp:1125] connect():  connected to g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com:443
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 200 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 1737 bytes...
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Date: Fri, 21 Jan 2022 03:07:20 GMT'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Type: application/json'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Content-Length: 1668'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'Connection: keep-alive'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amzn-RequestId: 5e4dfc30-3b02-49d9-8107-0b9ac3508c33'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'x-amz-apigw-id: MRp4PHA9IE0FvuQ='
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: 'X-Amzn-Trace-Id: Root=1-61ea2366-0de62cde0644a1012bbcb558;Sampled=0'
[V][HTTPClient.cpp:1216] handleHeaderResponse(): RX: ''
[D][HTTPClient.cpp:1257] handleHeaderResponse(): code: 200
[D][HTTPClient.cpp:1260] handleHeaderResponse(): size: 1668
[D][HTTPClient.cpp:603] sendRequest(): sendRequest code=200

[HTTP]https.POST() nResponseCode = 200 (), u32T = 3023
-------------------------------------
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:400] disconnect(): tcp is closed

<showSensorPacket()> stCount.u8SensorCount = 1
[20220121-120747:206] [APDS] 	      11 	      10 	      11 	      28 	       0
---------------------------------------------------------------------------------

[POST] Count = 0, Length = 1733
[V][HTTPClient.cpp:245] beginInternal(): url: https://g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com/device/data
[D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com port: 443 url: /device/data
[D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 60148
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[E][ssl_client.cpp:36] _handle_error(): [start_ssl_client():216]: (-17040) RSA - The public key operation failed : BIGNUM - Memory allocation failed
[E][WiFiClientSecure.cpp:133] connect(): start_ssl_client: -17040
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:1118] connect(): failed connect to g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com:443
[W][HTTPClient.cpp:1417] returnError(): error(-1): connection refused
[HTTP]https.POST() nResponseCode = -1 (4-?), u32T = 142
-------------------------------------
[HTTP]<Error> Correct? UDID=PAQ-TEST-002, WIFI_SSID=PAQ2.4G_Dev, WIFI_PW=8765022088
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:400] disconnect(): tcp is closed

<showSensorPacket()> stCount.u8SensorCount = 1
[20220121-121317:208] [APDS] 	      11 	      11 	      12 	      29 	       0
---------------------------------------------------------------------------------

[POST] Count = 0, Length = 1717
[V][HTTPClient.cpp:245] beginInternal(): url: https://g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com/device/data
[D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com port: 443 url: /device/data
[D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 59828
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
[V][ssl_client.cpp:257] start_ssl_client(): Free internal heap after TLS 14428
[D][HTTPClient.cpp:1125] connect():  connected to g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com:443
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 200 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 1717 bytes...
[D][HTTPClient.cpp:603] sendRequest(): sendRequest code=-11

[W][HTTPClient.cpp:1417] returnError(): error(-11): read Timeout
[D][HTTPClient.cpp:1419] returnError(): tcp stop
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[HTTP]https.POST() nResponseCode = -11 (P如?), u32T = 9542
-------------------------------------
[HTTP]<Error> httpsResponseCode = -11
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:400] disconnect(): tcp is closed

<showSensorPacket()> stCount.u8SensorCount = 1
[20220121-121847:208] [APDS] 	      12 	      11 	      12 	      30 	       0
--------------------------------------------------------------------------------
[POST] Count = 0, Length = 1747
[V][HTTPClient.cpp:245] beginInternal(): url: https://g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com/device/data
[D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com port: 443 url: /device/data
[D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 59500
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
[V][ssl_client.cpp:257] start_ssl_client(): Free internal heap after TLS 14100
[D][HTTPClient.cpp:1125] connect():  connected to g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com:443
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 200 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 1747 bytes...
[D][HTTPClient.cpp:603] sendRequest(): sendRequest code=-11

[W][HTTPClient.cpp:1417] returnError(): error(-11): read Timeout
[D][HTTPClient.cpp:1419] returnError(): tcp stop
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[HTTP]https.POST() nResponseCode = -11 (8??), u32T = 9789
-------------------------------------
[HTTP]<Error> httpsResponseCode = -11
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:400] disconnect(): tcp is closed

<showSensorPacket()> stCount.u8SensorCount = 1
[20220121-122417:205] [APDS] 	      12 	      11 	      13 	      32 	       0
---------------------------------------------------------------------------------

[POST] Count = 0, Length = 1738
[V][HTTPClient.cpp:245] beginInternal(): url: https://g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com/device/data
[D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com port: 443 url: /device/data
[D][HTTPClient.cpp:579] sendRequest(): request type: 'POST' redirCount: 0

[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 59176
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
[V][ssl_client.cpp:257] start_ssl_client(): Free internal heap after TLS 13776
[D][HTTPClient.cpp:1125] connect():  connected to g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com:443
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 200 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 1738 bytes...
[D][HTTPClient.cpp:603] sendRequest(): sendRequest code=-11

[W][HTTPClient.cpp:1417] returnError(): error(-11): read Timeout
[D][HTTPClient.cpp:1419] returnError(): tcp stop
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[HTTP]https.POST() nResponseCode = -11 (瓢?), u32T = 10334
-------------------------------------
[HTTP]<Error> httpsResponseCode = -11
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:400] disconnect(): tcp is closed
Normal operation time

Code: Select all

[20220121-114547:218]
[20220121-115117:223]
[20220121-115647:208]
[20220121-120217:209]

[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
The setlnsecure function works normally and the data is delivered to AWS.

Time of issue

Code: Select all

[20220121-120747:206]

V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:127] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[E][ssl_client.cpp:36] _handle_error(): [start_ssl_client():216]: (-17040) RSA - The public key operation failed : BIGNUM - Memory allocation failed
[E][WiFiClientSecure.cpp:133] connect(): start_ssl_client: -17040
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:1118] connect(): failed connect to g5me8ec8e8.execute-api.ap-northeast-2.amazonaws.com:443
[W][HTTPClient.cpp:1417] returnError(): error(-1): connection refused
[HTTP]https.POST() nResponseCode = -1 (4-?), u32T = 142

Who is online

Users browsing this forum: No registered users and 72 guests