<?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>NRF9160 Unable to disable certificate validation when connecting to https</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68229/nrf9160-unable-to-disable-certificate-validation-when-connecting-to-https</link><description>Hi all! Since I do not have a system for updating the certificate when changing the server, I decided to disable certificate verification when connecting to the https server. Here is the code: 
 Since the certificate is not needed I do not execute the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 Nov 2020 15:35:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68229/nrf9160-unable-to-disable-certificate-validation-when-connecting-to-https" /><item><title>RE: NRF9160 Unable to disable certificate validation when connecting to https</title><link>https://devzone.nordicsemi.com/thread/281161?ContentTypeID=1</link><pubDate>Fri, 20 Nov 2020 15:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac379c2f-f052-46c3-a256-e467bc57bb4c</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi, and sorry for being slow to reply.&lt;/p&gt;
&lt;p&gt;I tested, myself, and it worked as it should when I tested with google.com:443 and AWS&amp;#39;s root certificate. As expected, I was not able to connect to Google when I required peer verification, but I was able to connect when I disabled it.&lt;/p&gt;
&lt;p&gt;I then tried www.integrasources.com:443, and was not able to connect, same as you.&lt;/p&gt;
&lt;p&gt;However, running it through &lt;a href="https://www.ssllabs.com/ssltest/analyze.html?d=integrasources.com&amp;amp;hideResults=on"&gt;SSLabs&lt;/a&gt;, I see that integrasources.com does not support any of the cipher suites supported by the nRF9160. That is why we were not able to connect, not the peer verification.&lt;/p&gt;
&lt;p&gt;You can find a list over which cipher suites we support here: &lt;a href="https://www.nordicsemi.com/Software-and-tools/Prototyping-platforms/Nordic-Thingy-91/Download#infotabs"&gt;https://www.nordicsemi.com/Software-and-tools/Prototyping-platforms/Nordic-Thingy-91/Download#infotabs&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Unable to disable certificate validation when connecting to https</title><link>https://devzone.nordicsemi.com/thread/280355?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2020 12:48:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5ffa69c-abb6-4cd4-a7a7-c5445afedb2e</guid><dc:creator>Yury Morgunov</dc:creator><description>&lt;p&gt;Error code remains the same 95&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define EOPNOTSUPP 95 / * Operation not supported on socket * /&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When testing, I used GlobalSign-Root-CA-R2 which is located in the folder with the example&lt;/p&gt;
&lt;p&gt;Unfortunately now it is difficult to get trace log from the modem since I am using my board. The NRF9160 DK is currently not available.&lt;/p&gt;
&lt;p&gt;If it&amp;#39;s not difficult for you, try connecting for example to &lt;a href="https://www.integrasources.com"&gt;https://www.integrasources.com&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Unable to disable certificate validation when connecting to https</title><link>https://devzone.nordicsemi.com/thread/279763?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2020 14:30:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd5e9774-1933-4527-a364-8d926153f54b</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="Yury Morgunov"]if this certificate expires, will the connection still work?[/quote]
&lt;p&gt;&amp;nbsp;Yes, it should. You can easily test this by writing a wrong certificate to the modem, e.g. Google&amp;#39;s, AWS&amp;#39;s, one you create yourself. You should still be able to connect to your server.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Yury Morgunov"]I disable peer verification and download the CA certificate. Then I connect to the domain first.example.com, but I cannot connect to example.com. At the same time, first.example.com and example.com have certificates from letsencrypt. Why is that?[/quote]
&lt;p&gt;&amp;nbsp;What error code do you get?&lt;/p&gt;
&lt;p&gt;Still connect() failed with -95?&lt;/p&gt;
&lt;p&gt;Do you have any logs from the server that could inform us about what is wrong?&lt;/p&gt;
&lt;p&gt;A &lt;a href="https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/getting-started-cellular/posts/how-to-get-modem-trace-using-trace-collector-in-nrf-connect"&gt;modem trace&lt;/a&gt; could let us inspect the IP traffic between the modem and the server, which should give a good indication about what the problem is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Unable to disable certificate validation when connecting to https</title><link>https://devzone.nordicsemi.com/thread/279613?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2020 04:28:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3448719-2398-40f9-b77e-efc934917abe</guid><dc:creator>Yury Morgunov</dc:creator><description>&lt;p&gt;Okay, so if this certificate expires, will the connection still work?&lt;/p&gt;
&lt;p&gt;There is one more not clear feature:&lt;br /&gt;I disable peer verification and download the CA certificate. Then I connect to the domain first.example.com, but I cannot connect to example.com. At the same time, first.example.com and example.com have certificates from letsencrypt. Why is that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Unable to disable certificate validation when connecting to https</title><link>https://devzone.nordicsemi.com/thread/279496?ContentTypeID=1</link><pubDate>Wed, 11 Nov 2020 13:31:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d1db9a0-ce9d-4e7e-bce5-9d279bf779a1</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When using TLS, the modem requires either a root CA certificate or a pre-shared key (PSK) at a minimum.&lt;/p&gt;
&lt;p&gt;But, you can still disable peer verification. It will then accept any server, even if the certificates does not match.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>