<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Need to clarification on nrf http server example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124280/need-to-clarification-on-nrf-http-server-example</link><description>I’m working with the nRF7002 DK and following the guide for the HTTP server sample here: HTTP Server Example . The build process is successful, but when I flash the device, I see this in the terminal: 
 Welcome to minicom 2.9

OPTIONS: I18n
Port /dev</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Sep 2025 08:58:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124280/need-to-clarification-on-nrf-http-server-example" /><item><title>RE: Need to clarification on nrf http server example</title><link>https://devzone.nordicsemi.com/thread/548837?ContentTypeID=1</link><pubDate>Tue, 16 Sep 2025 08:58:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:489b800a-00d3-42dc-a5e6-879399dc1847</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I’m glad to hear that your Wi-Fi provisioning problem has been resolved. For this new issue, I recommend creating a separate ticket, as it is different from the original query you raised. This helps keep DevZone organized and makes it easier for others to find relevant information in the future.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt; Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to clarification on nrf http server example</title><link>https://devzone.nordicsemi.com/thread/548723?ContentTypeID=1</link><pubDate>Mon, 15 Sep 2025 10:44:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89e0d3db-0fe3-49ac-9e33-dac32f06313c</guid><dc:creator>dev_nxp</dc:creator><description>&lt;p&gt;Thanks! I managed to get the Wi-Fi connectivity working successfully. However, I&amp;#39;m now trying to send data over HTTP with TLS-PSK, but I&amp;#39;m encountering an error.&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.1.0-6c6e5b32496e ***
*** Using Zephyr OS v4.1.99-1612683d4010 ***
[00:00:00.513,641] &amp;lt;inf&amp;gt; http_server: HTTP Server sample started
[00:00:00.514,373] &amp;lt;inf&amp;gt; wifi_supplicant: wpa_supplicant initialized
[00:00:00.557,006] &amp;lt;inf&amp;gt; http_server: Network interface brought up
Connected
[00:00:22.569,335] &amp;lt;inf&amp;gt; http_server: Network connected
[00:00:22.570,434] &amp;lt;inf&amp;gt; http_server: Waiting for IPv6 HTTP connections on port 443, sock 12
[00:00:22.571,228] &amp;lt;inf&amp;gt; http_server: Waiting for IPv4 HTTP connections on port 443, sock 15
uart:~$ 
---- Sent utf8 encoded message: &amp;quot;net ipv4\r&amp;quot; ----
net ipv4
IPv4 support                              : enabled
IPv4 fragmentation support                : disabled
IPv4 conflict detection support           : disabled
Path MTU Discovery (PMTU)                 : disabled
Max number of IPv4 network interfaces in the system          : 1
Max number of unicast IPv4 addresses per network interface   : 1
Max number of multicast IPv4 addresses per network interface : 2

IPv4 addresses for interface 1 (0x200013c8) (WiFi)
================================================
Type            State           Ref     Address
DHCP    preferred       1       10.250.23.68/255.255.255.0
[00:01:09.488,677] &amp;lt;err&amp;gt; http_server: Error in accept -2, try again
[00:01:36.104,064] &amp;lt;err&amp;gt; http_server: Error in accept -2, try again
[00:02:34.461,883] &amp;lt;err&amp;gt; http_server: Error in accept -2, try again
[00:03:35.459,259] &amp;lt;err&amp;gt; http_server: Error in accept -2, try again&lt;/pre&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
 * Copyright (c) 2024 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/net/tls_credentials.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/logging/log_ctrl.h&amp;gt;

static const unsigned char server_certificate[] = {
#if defined(HTTP_SERVER_CA_CERT)
#include HTTP_SERVER_CA_CERT

/* Null terminate certificate */
(0x00)
#else
&amp;quot;&amp;quot;
#endif
};

static const unsigned char server_private_key[] = {
#if defined(HTTP_SERVER_PRIVATE_KEY)
#include HTTP_SERVER_PRIVATE_KEY

/* Null terminate certificate */
(0x00)
#else
&amp;quot;&amp;quot;
#endif
};

static const unsigned char psk[] = {0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
static const char psk_id[] = &amp;quot;PSK_identity&amp;quot;;

#define PSK_TAG 42

LOG_MODULE_REGISTER(http_server_credentials_provision, CONFIG_HTTP_SERVER_SAMPLE_LOG_LEVEL);
int credentials_provision(void)
{
	int ret;

	ret = tls_credential_add(PSK_TAG,
				 TLS_CREDENTIAL_PSK_ID,
				 psk_id,
				 sizeof(psk_id));

	if (ret == -EEXIST) {
		LOG_DBG(&amp;quot;CA certificate already exists, sec tag: %d&amp;quot;,
			CONFIG_HTTP_SERVER_SAMPLE_SERVER_CERTIFICATE_SEC_TAG);
	} else if (ret &amp;lt; 0) {
		LOG_ERR(&amp;quot;Failed to register CA certificate: %d&amp;quot;, ret);
		return ret;
	}

	ret = tls_credential_add(PSK_TAG,
				 TLS_CREDENTIAL_PSK,
				 psk,
				 sizeof(psk));
	if (ret == -EEXIST) {
		LOG_DBG(&amp;quot;Public certificate already exists, sec tag: %d&amp;quot;,
			CONFIG_HTTP_SERVER_SAMPLE_SERVER_CERTIFICATE_SEC_TAG);
	} else if (ret &amp;lt; 0) {
		LOG_ERR(&amp;quot;Failed to register public certificate: %d&amp;quot;, ret);
		return ret;
	}

	// ret = tls_credential_add(CONFIG_HTTP_SERVER_SAMPLE_SERVER_CERTIFICATE_SEC_TAG,
	// 			 TLS_CREDENTIAL_PRIVATE_KEY,
	// 			 server_private_key, sizeof(server_private_key));

	// if (ret == -EEXIST) {
	// 	LOG_DBG(&amp;quot;Private key already exists, sec tag: %d&amp;quot;,
	// 		CONFIG_HTTP_SERVER_SAMPLE_SERVER_CERTIFICATE_SEC_TAG);
	// } else if (ret &amp;lt; 0) {
	// 	LOG_ERR(&amp;quot;Failed to register private key: %d&amp;quot;, ret);
	// 	return ret;
	// }

	return 0;
}
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;on other side&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;openssl s_client -connect 10.250.23.68:443 -tls1_2 \
  -psk 010102030405060708090a0b0c0d0e0f \
  -psk_identity &amp;quot;PSK_identity&amp;quot;
CONNECTED(00000003)
40A7A17E5C790000:error:0A000126:SSL routines:ssl3_read_n:unexpected eof while reading:../ssl/record/rec_layer_s3.c:316:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 247 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : 0000
    Session-ID: 
    Session-ID-ctx: 
    Master-Key: 
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1757932743
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: no
---
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to clarification on nrf http server example</title><link>https://devzone.nordicsemi.com/thread/548567?ContentTypeID=1</link><pubDate>Fri, 12 Sep 2025 08:19:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9da5d8a2-2f55-4c06-9b26-c45c491524f7</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry, I was out of the office yesterday, which caused the delay in responding to this issue.&lt;/p&gt;
&lt;p&gt;From the shared logs, it looks like Wi-Fi is not connected, although the sample you flashed is working. I believe this is because the&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/http_server/README.html#configuring_wi-fi_access_point_credentials"&gt; Wi-Fi credentials have not been configured&lt;/a&gt;. This is mentioned in the documentation for the sample. Please also refer to &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/connectivity/networking/api/wifi_credentials.html#lib-wifi-credentials"&gt;the Wi-Fi credential library&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The difference between the Zephyr HTTP sample and the Nordic sample is that our SDK sample is tailored for Nordic boards and includes overlays for running on our boards. The Zephyr sample, on the other hand, is a more&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/net/sockets/http_server/README.rst"&gt; generic example showcasing the HTTP server library.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt; Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>