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
  • Sorry, here's the GitHub link I referred to: https://github.com/craigpeacock/Zephyr_WiFi/blob/main/README.md 

    Here on DevZone we never speculate or discuss future releases or products, as we strive to focus on the currently available solutions. If you want information on future releases, please contact the regional sales manager (RSM) of your area, as they'll be able to share info on what's planned for when, etc. Let me know if you need help reaching out to your local RSM.

    Best regards,

    Simon

  • 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));

Reply
  • 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));

Children
No Data
Related