nRF7002DK HTTPS Client Sample Not Connecting to AP 100% of the times when it does and it tries to connect to HTTP server it fails with error code 113

Hi,

I'm facing two issues when trying out the HTTPS Client sample from NCS 2.5.2 with build target nrf7002dk_nrf5340_cpuapp. After calling function conn_mgr_all_if_connect(true) and then waiting for the semaphore to be given once the  on_net_event_l4_connected is called, the program never gets it. I've waited for over 1 minute and I also don't get a timeout error which would happen if the credentials are wrong (i've tested this). The weird thing is that it sometimes works. If I keep resetting the board it will connect eventually but then I face the second problem.

When try connect tp "example.com" I get two types of errors:

  • getaddrinfo() failed, err 0
  • connect() failed, err: 113

I get the second one more often that the first one. The error code 113 is defined as ECONNABORTED with description "Software caused connection abort". What does this mean? Attached is the logs of when I got this issue. I've tried other sites like the "nytimes.com" or "google.com" and I don't get this error. With other sites I sometimes get the error 116 (ETIMEDOUT). I've only gotten this sample to work with the "nytimes.com" hostname. 

I have also tried the sample out-of-the-box in NCS 2.5.0 and I get the same issues. Can you please help me with this issue? Thanks

Best,

Ale

[00:00:00.536,224] <inf> fs_nvs: 6 Sectors of 4096 OK
bytes
[00:00:00.536,254] <inf> fs_nvs: alloc wra: 0, fe8
[00:00:00.536,254] <inf> fs_nvs: data wra: 0, 0
*** Booting nRF Connect SDK v2.5.2 ***
HTTPS client sample started
Bringing network interface up
Provisioning certificate
Connecting to the network
[00:00:01.854,309] <inf> wifi_mgmt_ext: Connection requested
Network connectivity established and IP address assigned
Looking up example.com
Resolved 93.184.216.34 (AF_INET)
Connecting to example.com:443
connect() failed, err: 113
OK
Network connectivity lost
Disconnected from the network

Parents
  • Hi,

    It seems like the default certificates are incorrect. I got the same error as you, ECONNABORTED when trying to run the sample out of the box. I downloaded new certificates for example.com and it works well with those.

    I have attached the certificate I used, so please test it and let me know if you still see the issue. Devzone does not support uploading .pem files, so I attached it as a .zip.

    Remember that you need to use certificates for the server you are connecting to, so if you are connecting to, for example, google.com, you need to use certificates for google.com.

    5543.DigiCertGlobalRootG2.zip

    Best regards,
    Marte

  • Hi,

    I checked this internally, and this has already been fixed on the main branch, so it should be correct in the next release of nRF Connect SDK.

    There seems to be an issue with the file in my previous reply, so I have uploaded it again in this reply.


    1588.DigiCertGlobalRootG2.zip

    Best regards,
    Marte

  • Hi,

    The new certificate worked! I'm not getting the ECONNABORTED error anymore and have gotten the sample to work out of the box. I'm still getting the other issues ocassionally . Is there any idea on what might be happening? Here are the logs of when I get the getaddrinfo() error:

    *** Booting nRF Connect SDK v2.5.2 ***
    HTTPS client sample started
    Bringing network interface up
    Provisioning certificate
    Connecting to the network
    [00:00:01.839,324] <inf> wifi_mgmt_ext: Connection requested
    Network connectivity established and IP address assigned
    Looking up example.com
    getaddrinfo() failed, err 0
    OK
    Network connectivity lost
    Disconnected from the network

Reply
  • Hi,

    The new certificate worked! I'm not getting the ECONNABORTED error anymore and have gotten the sample to work out of the box. I'm still getting the other issues ocassionally . Is there any idea on what might be happening? Here are the logs of when I get the getaddrinfo() error:

    *** Booting nRF Connect SDK v2.5.2 ***
    HTTPS client sample started
    Bringing network interface up
    Provisioning certificate
    Connecting to the network
    [00:00:01.839,324] <inf> wifi_mgmt_ext: Connection requested
    Network connectivity established and IP address assigned
    Looking up example.com
    getaddrinfo() failed, err 0
    OK
    Network connectivity lost
    Disconnected from the network

Children
Related