Hello together,
i am trying to connect to an Azure Blob Storage Container via https with a nrf9160 but I am only getting error 111 (connection refused). For that I am using the https_client sample as first step.
I modified the sample:
1. I copied the contents of nrf9160dk_nrf9160_ns.conf to actinius_icarus_ns.conf and added this line to my board config
CONFIG_HTTPS_HOSTNAME="xxxx.blob.core.windows.net"
2. Used Firefox to download the DigiCert Global Root G2 certificate (named "blob-core-windows-net.pem". see attachment under /cert).
3. Changed the input file of that nice little function in the CMake file so that it reads in the correct certificate (Digicert):
generate_inc_file_for_target(
app
cert/blob-core-windows-net.pem
${gen_dir}/DigiCertGlobalG2.pem.inc
)
Then I am flashing the board and reading the output via a serial terminal.
The output is the following (Note: I replaced the actual host and ip with a placeholder):
*** Booting nRF Connect SDK v2.8.0-a2386bfc8401 *** *** Using Zephyr OS v3.7.99-0bc3393fb112 *** HTTPS client sample started Bringing network interface up Provisioning certificate Certificate match Connecting to the network +CEREG: 2,"81A6","0327BB04",7 +CSCON: 1 +CGEV: ME PDN ACT 0,0 +CNEC_ESM: 50,0 %MDMEV: SEARCH STATUS 2 +CEREG: 5,"81A6","0327BB04",7,,,"00011110","11000001" Network connectivity established and IP address assigned Looking up xxxx.blob.core.windows.net Resolved 57.150.xxx.x (AF_INET) Connecting to xxxx.blob.core.windows.net:443 connect() failed, err: 111 +CGEV: ME PDN DEACT 0 +CEREG: 0 +CGEV: ME DETACH +CSCON: 0 Network connectivity lost Disconnected from the network
I am also able to verify the certificate provision through a AT command:
AT%CERTEXPIRY=42,0 %CERTEXPIRY: 033AF1E6A711A9A0BB2864B11D09FAE5,20130801120000Z,20380115120000Z OK
...which is exactly the expire date of the DigiCert Global Root G2 certificate (15. jan. 2038).
I also verified the connection using openssl on my linux machine:
openssl s_client -connect xxxx.blob.core.windows.net:443 -verify_return_error -CAfile blob-core-windows-net.pem
which returns error "Verify return code: 20 (unable to get local issuer certificate)" if I set in the wrong certificate. When I use the DigiCert Global Root G2 certificate (named "blob-core-windows-net.pem") the command connects me to the server without errors.
What am I doing wrong here? How can I connect to a Azure Blob Storage Container?
I attached the project folder below. I am also able to provide a Modem Trace for that case, if you tell me how you would like to receive it in a more private manner.
I am using the nrf9160 on a Actinius Icarus Board.
SDK Version: 2.8.0
Modem FW Version: 1.3.7