nrf9160 HTTPs_CLIENT example not working

Hi,

I'm using nrf9160dk  and i want to run HTTPS_CLIENT example to send some ping.

when i run the HTTPS_CLIENT  I'm getting error:-  "getaddrinfo() failed, err 0" 

i haven't change anything in code expect  HTTPS_HOSTNAME.

please help to clear this Error.

Thanks  

Parents
  • Hi Bhanu,

    Please check the following points.

    1) Please use the pure HTTPS_HOSTNAME "herokuapp.com". Your local network may not provide DNS, please try with the server IP directly if it still does not work.

    2) Use the send_buf to send something like the below. You also need to change cert[] with CA used by your server domain. I suggest you verify with some REST clients like Postman first to make sure the server side works.

    #define HTTP_REQUEST   
    	"POST /api/sensor_reading_https/"                                     \
    	"HEAD / HTTP/1.1\r\n"                                                 \
    	"Host: " HTTPS_HOSTNAME ":80\r\n"                                     \
    	"Connection: close\r\n\r\n"

    Best regards,

    Charlie

  • Hi charlie,

    Please use the pure HTTPS_HOSTNAME "herokuapp.com".

    i have used this host name alsoand im getting connect() failed ,err: 111

    You also need to change cert[] with CA used by your server domain.

    our host name doesn't have certificates we are using https with out certificates

    And i have tested the host name in postman application and it working fine that.

    thanks

Reply Children
No Data
Related