TLS handshake error -3b00 on nRF7002

nrfConnect SDK 2.3.0

IDE: VS code

Console Error:

Connecting to HTTP Server:
[00:00:23.982,177] <err> net_sock_tls: TLS handshake error: -3b00

project setup:

I started with the sta example to connect the nrf7002 to wifi Then I pulled in the example for https requests using TLS from zephyr's github, https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/net/sockets/http_get/src/http_get.c

Are there any nrf7002 compatible examples for how to connect to an HTTPS server over port 443 to POST and GET data?

Parents Reply Children
  • Thanks for the link, I already have that code merged in with the STA example for basic HTTP requests and have that working successfully, however for what I am doing I need to added security using HTTPS, which is where the problem seams to be. The server I am connecting to only allows HTTPS requests.

    Would there be something chip side that is not allowing it to connect to any HTTPS server?

    I use tls_credential_add to add the Certificate in the der format for the server I am connecting to and also set socket options (as shown)

    // Create Socket
    	sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TLS_1_2); // IPPROTO_TCP //IPPROTO_TLS_1_2
    	if (sock < 0) {
    		printk("Error creating socket\n");
    		return(-1);
    	}
    	// TLS settings
    	sec_tag_t sec_tag_opt[] = {
    		CA_CERTIFICATE_TAG,
    	};
    	setsockopt(sock, SOL_TLS, TLS_SEC_TAG_LIST,
    			 sec_tag_opt, sizeof(sec_tag_opt));
    
    	setsockopt(sock, SOL_TLS, TLS_HOSTNAME,
    			 SERVER_HOSTNAME, sizeof(SERVER_HOSTNAME));

Related