This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SSL CERTIFICATION READ ISSUE NRF9160 FOTA

Hi,

 i am trying to read the written certificate detail to verify. but i got the error of EPERM, 

 The below log is the response for my aws_fota program, 

The MQTT AWS Jobs FOTA Sample
nrf_inbuilt_key_delete(16842753, 0) => result=0
nrf_inbuilt_key_delete(16842753, 1) => result=0
nrf_inbuilt_key_delete(16842753, 2) => result=0
nrf_inbuilt_key_write => result=0
nrf_inbuilt_key_write => result=0
nrf_inbuilt_key_write => result=0

i got the CA detail and i got EPERM error for both private and public key detail. find my code below

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
u8_t buffer_read[2000]; // declared globally
void read_Credential()
{
int err;
u16_t size = 2000;
err = nrf_inbuilt_key_read(CONFIG_CLOUD_CERT_SEC_TAG,NRF_KEY_MGMT_CRED_TYPE_CA_CHAIN,
&buffer_read,&size);
if(err == 0)
{
printk("Read CA Successfully\n %s\n",buffer_read);
}
else
{
printk("Read Failure%d",err);
}
memset(buffer_read,'\0',strlen(buffer_read));
err = nrf_inbuilt_key_read(CONFIG_CLOUD_CERT_SEC_TAG,NRF_KEY_MGMT_CRED_TYPE_PRIVATE_CERT,
&buffer_read,&size);
if(err == 0)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

once i through this, i have to ensure the mqtt data push....

kindly help me to sort this out

Parents
  • Hi.

    This is the intended behavior.

    You are only allowed to read back CA certificates.

    Merry Christmas!

    Didrik

  • Hi Didrik,

    Thank you for your respose, then why should sample program always says

    POLLNVAL error.

    the mqtt is connected but it always show the above error in aws_fota sample..

    thanks

    Hmdra

  • Do you get another error earlier in the log?

    POLLNVAL is usually because the socket has been closed from somewhere else.

    Have you also checked that the client ID and endpoint that you try to connect to is correct?

  • Hi Didrik,

       MQTT  event respond as connected but still having the same issue. the log shown below

    [mqtt_evt_handler:136] MQTT client connected!
    POLLNVAL
    Disconnecting MQTT client...
    [mqtt_evt_handler:149] MQTT client disconnected -57
    Could not disconnect MQTT client. Error: -57

    thanks

    hmdra

Reply
  • Hi Didrik,

       MQTT  event respond as connected but still having the same issue. the log shown below

    [mqtt_evt_handler:136] MQTT client connected!
    POLLNVAL
    Disconnecting MQTT client...
    [mqtt_evt_handler:149] MQTT client disconnected -57
    Could not disconnect MQTT client. Error: -57

    thanks

    hmdra

Children
  • As I said, it looks like the server is closing the connection, which leads to POLLNVAL and "not connected" errors (-57) on your end.

    Are you trying to connect to nRF Cloud or your own AWS instance?

    Have you verified that you are using the correct client ID, and connect to the correct endpoint?