Stuck in loading certificate

Hello Sequans team,

I am developing an application which requires to connect to an HTTPS server, and I am encountering the error 77 after using AT+SQNHTTPCONNECT

Could you please guide me what should I do to diagnose my problem ?

Thank you in advance!

Here is a snapshot of my log

+SYSSTART

AT+SQNSNVW=“certificate”,19,0

OK

AT+SQNSNVW=“certificate”,19,2584

-----BEGIN CERTIFICATE-----

MIIHY…

–END CERTIFICATE-----

OK

AT+CFUN=1

OK
+CEREG: 2
+CEREG: 5,“E198”,“043A5E0A”,7

AT+SQNSPCFG=1,2,“”,7,19
+SQNSPCFG: 1,2,“”,7,19,“”,“”,0,0,0
OK

AT+SQNHTTPCFG=1,“api.smsapi.pl/sms.do”,443,0,“”,“”,1,120,1,1
OK

AT+SQNHTTPCONNECT=1

OK
+SQNHTTPCONNECT: 1,77
+SQNHTTPSH: 1,77

Hi,

It seems that the SQNHTTPCONNECT command is failing with Error 77, which indicates an SSL certificate validation issue.

Looking at the provided configuration:

+SQNSPCFG: 1,2,“”,7,19,“”,“”,0,0,0

The value for the certValidLevel field is set to 7. According to the At command ref manual, this is not the correct value. Please refer to the details below to choose the right value.(copied rom At command ref manual)

====

certValidLevel
Bit field: 8 bits wide (00..FF): Server certificate validation.
Configuration bits:

All 0 (default): Certificate not validated.

Bit 0 set to 1: Certificate validation done against a specific or a list of imported trusted root certificates and against a validity period.

Bit 1: unused.

Bit 2 set to 1: Server’s URL verified against the certificate common name field. This option cannot be used standalone and must be enabled together with the trusted root/date validation (i.e. bit 0 must be set in order for this bit to be set also).

Bit 3-7 are reserved for future use.
For instance, to activate certification verification including validity period check, =0x01

===

For example, to enable full certificate validation (including the validity period check), you should set certValidLevel = 0x01.

Additional Consideration:

  • Ensure that at index 19, you have stored the correct CA certificate for validating the server certificate ID. It is essential to use the exact certificate for this process.

If the issue persists, please capture the logs using the tools located in the \Tools\DM Light\sqn4gdm_light_setup_1.3-891 directory. I have attached a log mask that you can use to capture the logs, following the instructions in section 4.3.2 of the document DMLight-UserGuide-Rev.3.

I am attaching the log mask you can use to capture the logs following the instructions under the section 4.3.2. Recording in the document DMLight-UserGuide-Rev.3

Thanks.

SQNSPCFG_logmask.dmrec (838 Bytes)

.

1 Like

Thank you very much for this clear explanation.

I am now using +SQNSPCFG: 1,2,“”,1,19,“”,“”,0,0,0 and now it fixes my issue.

Thanks for your support!