<?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>how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114240/how-to-use-curl-with-tls-implementation</link><description>Hello 
 I&amp;#39;m evaluating cURL with nrf9160DK,zephyrOS. 
 Finally, it goes well with cURL - http - however, it cant do with TLS - https - 
 Could you let me know how to implement TLS/SSL for using cURL ? 
 Does it require some config ? 
 
 Here is my snipet</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Sep 2024 08:07:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114240/how-to-use-curl-with-tls-implementation" /><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/504106?ContentTypeID=1</link><pubDate>Fri, 27 Sep 2024 08:07:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b646022d-5e68-4797-8063-661cd9d4da52</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Okay, thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/504062?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 20:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1406407e-b577-49da-817f-a74e61718901</guid><dc:creator>s-shige</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;We have a few customers that using Nordic.&lt;/p&gt;
&lt;p&gt;That kind point of view regarding your chip product will be some volume of K, M numbers.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/503232?ContentTypeID=1</link><pubDate>Fri, 20 Sep 2024 09:35:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c9308b4-f1fc-4e12-819f-b49b11161187</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;If you are able to provide a list of how many that asks about this, we can forward this as a feature request.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/503217?ContentTypeID=1</link><pubDate>Fri, 20 Sep 2024 08:16:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be75e1a5-a75e-44e0-98d1-5b8a8dbdb620</guid><dc:creator>s-shige</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Thank you for your update.&lt;/p&gt;
&lt;p&gt;I can confirm cURL (without TLS) is available.&lt;/p&gt;
&lt;p&gt;but, need &amp;quot;CONFIG_NET_SOCKETS_POSIX_NAMES=n&amp;quot; so, some hand craft to implement socket function with zepher API.&lt;/p&gt;
&lt;p&gt;Anyway, TLS(mbedTLS) is not supported for now, I understand.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We have often request about this feature support from customers.&lt;/p&gt;
&lt;p&gt;so, I hope it will support shortly.&lt;/p&gt;
&lt;p&gt;thx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/503200?ContentTypeID=1</link><pubDate>Fri, 20 Sep 2024 06:35:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:369424f2-c355-472b-bccf-c4fafe7de104</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Michal is currently out of office and I have been assigned his ticket while he is out.&amp;nbsp;&lt;/p&gt;
[quote user="s-shige"]That means this is not support ?[/quote]
&lt;p&gt;Yes, there is currently no support for cURL and HTTPS in our nRF Connect SDK. The cURL library in our SDK was introduced for our Cellular: Modem shell sample.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/502653?ContentTypeID=1</link><pubDate>Mon, 16 Sep 2024 19:22:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02e0a4dd-94f8-4e90-9fde-6ff9e411fa3f</guid><dc:creator>s-shige</dc:creator><description>&lt;p&gt;Dear,&lt;br /&gt;Thank you for your kind messages.&lt;/p&gt;
&lt;p&gt;That means this is not support ?&lt;/p&gt;
&lt;p&gt;I noticed that mbedTLS build system (automatically) is not start with west command. it need to enable &amp;quot;USE_TLS&amp;quot; manually.&lt;br /&gt;And additionally, many hand craft is being required for now. (still not going well..struggling CONFIG conflict)&lt;/p&gt;
&lt;p&gt;Could you let me know correct CONFIG to build curl/mbedTLS ?&lt;br /&gt;and is this correct mbedTLS version included ?&lt;br /&gt;I&amp;#39;m using SDK v2.6.1.&lt;/p&gt;
&lt;p&gt;thx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/502354?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2024 15:31:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:038662e0-1d9c-4ef7-8e7f-5b0532a6849e</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;I am checking that internally, but I am not sure if there are any concrete numbers I&amp;#39;d be able to find &lt;/p&gt;
&lt;p&gt;Since we don&amp;#39;t have a ready curl implementation with HTTPS support, you the answer may be that you need to experiment on your own.&lt;/p&gt;
&lt;p&gt;We have a &lt;a href="https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/memory_report.html"&gt;Memory Report&lt;/a&gt; tool in the nRF Connect for VS Code extension to help out with that as well.&lt;/p&gt;
&lt;p&gt;I tried some basic experiments, but those were too basic and didn&amp;#39;t really increase the code by more than the bare minimum.&lt;/p&gt;
&lt;p&gt;Best regards.&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/502172?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2024 16:06:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc879bb3-191a-4db2-912f-0b25f19ed54e</guid><dc:creator>mark.blackburn.orpyx</dc:creator><description>&lt;p&gt;Do you have an idea how much additional flash and RAM adding mbedTLS would add?&lt;/p&gt;
&lt;p&gt;For my project I&amp;nbsp;am making architectural decisions and I want to know what the risk/impact of using mbedTLS would be.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/502150?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2024 13:28:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0121cbfc-3eff-4a61-ae9f-cd7245ba8d39</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is curl necessary in your situation? Implementing HTTPS with curl will be heavy for flash and RAM. You will have to start with configuring mbedTLS for that.&lt;/p&gt;
&lt;p&gt;For HTTPS in general we would recommend using for example our &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/https_client/README.html"&gt;HTTPS Client&lt;/a&gt; sample as the base.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/501602?ContentTypeID=1</link><pubDate>Sat, 07 Sep 2024 04:04:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76ac8c69-c25c-48e6-a88b-5d036e87f86b</guid><dc:creator>s-shige</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Still not going well and I&amp;#39;m looking for solution.&lt;/p&gt;
&lt;p&gt;Any idea and advice would be highly appreciated.&lt;/p&gt;
&lt;p&gt;thx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/501036?ContentTypeID=1</link><pubDate>Tue, 03 Sep 2024 17:43:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:409a0ffb-b6e0-4927-aef0-c3a95b4a4a43</guid><dc:creator>mark.blackburn.orpyx</dc:creator><description>&lt;p&gt;Thanks, I&amp;#39;ve checked it out. It does not allow requests with https&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll look deeper to see if it can be enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/501031?ContentTypeID=1</link><pubDate>Tue, 03 Sep 2024 16:50:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb8c2ca1-5212-48f8-af80-7dffde874ac5</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;I would recommend maybe looking into the source code for our &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/nrf/samples/cellular/modem_shell/README.html#curl"&gt;MoSh sample&lt;/a&gt;, since we implement curl there.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/500663?ContentTypeID=1</link><pubDate>Sun, 01 Sep 2024 06:12:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e5fdf95-e486-464b-83f4-6f8824638441</guid><dc:creator>s-shige</dc:creator><description>&lt;p&gt;Updated my code and however, still no work well.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;gt;&amp;gt;curl_version_info(CURLVERSION_NOW);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Return - http&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;gt;&amp;gt;curl_easy_perform() failed: Unsupported protocol&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;how to integrated SSL/TLS ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;here is the snipet code&lt;/p&gt;
&lt;p&gt;-----------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;static void https_request_example(void) {&lt;br /&gt; CURL *ch;&lt;br /&gt; CURLcode ret;&lt;/p&gt;
&lt;p&gt;char *response = malloc(4096); // Allocate initial memory for the response&lt;br /&gt; if (response == NULL) {&lt;br /&gt; LOG_ERR(&amp;quot;Memory allocation failed for response buffer&amp;quot;);&lt;br /&gt; return;&lt;br /&gt; }&lt;br /&gt; response[0] = &amp;#39;\0&amp;#39;; // Initialize the response buffer&lt;/p&gt;
&lt;p&gt;LOG_INF(&amp;quot;Starting HTTPS request example&amp;quot;);&lt;/p&gt;
&lt;p&gt;/* Dynamically allocate memory for the PEM certificate */&lt;br /&gt; char *mypem = (char *)malloc(strlen(cert_pem) + 1);&lt;br /&gt; if (!mypem) {&lt;br /&gt; printf(&amp;quot;malloc failed for PEM certificate\n&amp;quot;);&lt;br /&gt; return CURLE_OUT_OF_MEMORY;&lt;br /&gt; }&lt;br /&gt; strcpy(mypem, cert_pem);&lt;/p&gt;
&lt;p&gt;curl_global_init(CURL_GLOBAL_ALL);&lt;br /&gt; ch = curl_easy_init();&lt;br /&gt; if (ch) {&lt;/p&gt;
&lt;p&gt;curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, &amp;quot;PEM&amp;quot;);&lt;br /&gt; curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 1L);&lt;br /&gt; curl_easy_setopt(ch, CURLOPT_URL, &amp;quot;&lt;a href="https://www.example.com/"&gt;&amp;quot;&amp;gt;https://www.example.com/&amp;quot;);&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;/* Install the function to modify the SSL context */&lt;br /&gt; curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);&lt;br /&gt; curl_easy_setopt(ch, CURLOPT_SSL_CTX_DATA, mypem);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; // Set the callback function for handling response data&lt;br /&gt; curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, write_callback);&lt;br /&gt; curl_easy_setopt(ch, CURLOPT_WRITEDATA, (void *)&amp;amp;response);&lt;/p&gt;
&lt;p&gt;#if 1&lt;br /&gt;curl_version_info_data *curl_info = curl_version_info(CURLVERSION_NOW);&lt;br /&gt;if (curl_info-&amp;gt;protocols) {&lt;br /&gt; const char * const *proto;&lt;br /&gt; for (proto = curl_info-&amp;gt;protocols; *proto; ++proto) {&lt;br /&gt; LOG_INF(&amp;quot;Supported protocol: %s\n&amp;quot;, *proto);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;// Perform the request&lt;br /&gt; ret = curl_easy_perform(ch);&lt;/p&gt;
&lt;p&gt;// Check if the request was successful&lt;br /&gt; if (ret != CURLE_OK) {&lt;br /&gt; LOG_ERR(&amp;quot;curl_easy_perform() failed: %s&amp;quot;, curl_easy_strerror(ret));&lt;br /&gt; } else {&lt;br /&gt; // Print the response&lt;br /&gt; LOG_INF(&amp;quot;Response: %s&amp;quot;, response);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;// Clean up and free the resources&lt;br /&gt; curl_easy_cleanup(ch);&lt;br /&gt; free(response);&lt;/p&gt;
&lt;p&gt;} else {&lt;br /&gt; LOG_ERR(&amp;quot;Failed to initialize curl&amp;quot;);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;/* Clean up */&lt;br /&gt; curl_easy_cleanup(ch);&lt;br /&gt; curl_global_cleanup();&lt;br /&gt; free(mypem); /* Free dynamically allocated memory */&lt;br /&gt; free(response);&lt;/p&gt;
&lt;p&gt;return ret;&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use cURL with TLS implementation</title><link>https://devzone.nordicsemi.com/thread/499871?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 04:14:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be6667fa-fff3-43d6-8fa8-f485712b608a</guid><dc:creator>mark.blackburn.orpyx</dc:creator><description>&lt;p&gt;My guess is that you need to add the root certificate for&amp;nbsp;httpbin.org.&lt;/p&gt;
&lt;p&gt;Try using the cert_provision function from&amp;nbsp;nrf/samples/net/download/src/main.c&lt;/p&gt;
&lt;p&gt;That function is used for most of the https examples for the nRF9160. It loads the required TLS certificates into the modem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you post your full project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>