<?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>Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115810/cannot-connect-to-lwm2m-server-with-x509-dtls-wireshark-shows-empty-client-certificate</link><description>Hi, 
 I am developing a product based on the nRF9160 using the LwM2M client. I successfully have this working using PSK, but want to use X509. 
 I am calling lwm2m_security_set_certificate() where I previously called lwm2m_security_set_psk() and have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Nov 2024 13:19:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115810/cannot-connect-to-lwm2m-server-with-x509-dtls-wireshark-shows-empty-client-certificate" /><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/511090?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2024 13:19:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8de43c8c-b440-47f2-a12b-0dcc0c1bba42</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Thanks a lot for let us know!&lt;/p&gt;
&lt;p&gt;&amp;gt; hope that it gets fixed in future releases&amp;nbsp;&lt;/p&gt;
&lt;p&gt;cross the fingers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/511085?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2024 13:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fda6dd8-fa79-4c94-8cd2-3c729d943ebd</guid><dc:creator>SeppoTakalo</dc:creator><description>&lt;p&gt;No, I don&amp;#39;t think there is any such documentation.&lt;/p&gt;
&lt;p&gt;This is something I just discovered recently, and just send a PR to nRF SDK&amp;nbsp;&lt;a id="" href="https://github.com/nrfconnect/sdk-nrf/pull/18892"&gt;https://github.com/nrfconnect/sdk-nrf/pull/18892&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For nRF91 modem, the release notes only lists limitations of the TLS stack. The AT command manual only gives instructions regarding the use of AT, but does not explain any details of TLS stack. However, this has now been reported internally to modem team, so I hope that it gets fixed in future releases and for current releases it needs documentation update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/511055?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2024 10:57:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4db8541-29a7-4e30-a8dc-3e759f39ebb6</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;That&amp;#39;s a really nasty pitfall.&lt;/p&gt;
&lt;p&gt;Is there some documentation about that preference of PSK credentials even when other cipher suites are negotiated?&lt;/p&gt;
&lt;p&gt;I would like to link a own source snipped removing the PSK credentials in that case with such a source.&lt;/p&gt;
&lt;p&gt;Otherwise I would refer to this ticket.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/511053?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2024 10:47:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d9eeee4-5839-4303-b7c5-a0f2ca89cf95</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Thanks! Surprising effect.&amp;nbsp; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/511048?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2024 10:33:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bb3229b-1a4c-410b-9e36-3c1ea512ed43</guid><dc:creator>Scytmo</dc:creator><description>&lt;p&gt;Aha!&amp;nbsp; Thank you very much!&amp;nbsp; This also explains why using a different security tag appeared to solve the problem - as I only have X509 credentials in that security tag.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/511046?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2024 10:29:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b778514-aea7-4f32-a88a-6f7d7521da51</guid><dc:creator>SeppoTakalo</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I would like to comment here that problems described here are not caused by LwM2M engine itself, nor does it mean that X509 would not work.&lt;/p&gt;
&lt;p&gt;What happens is as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;nRF91 modem stores security credential in placeholders called &amp;quot;security tags&amp;quot;. You can store PSK credentials, private keys or X509 client or CA certificates on security tags. See AT command manual for CMNG command for details. These credential are stored before connection starts.&lt;/li&gt;
&lt;li&gt;When given security tag contains both client certificate and PSK credentials the TLS stack inside modem tries to use PSK.&lt;/li&gt;
&lt;li&gt;If you set a ciphersuite for TLS using `zsock_setsockopt&lt;span&gt;(fd, SOL_TLS, TLS_CIPHERSUITE_LIST, ...)` this information is fed into TLS handshake, but does not affect the selection of PSK/X509 from given security tag. This ciphersuite socket option is used inside LwM2M engine to switch between X509 of PSK mode when connecting.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;When LWM2M engine tries to connect in X509 mode, but sectag has both, modem runs into conflict as selected ciphersuites don&amp;#39;t allow PSK, so it send empty certificate.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To fix the issue:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Remove all credentials from security tag before you write new ones, if new ones are different type.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/510427?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2024 09:19:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a314635-ea8f-4209-9694-91f55c21c7e3</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;You&amp;#39;re welcome.&lt;/p&gt;
&lt;p&gt;As developer of Eclipse/Californium I usually try to check, if there is some issue with that. So far my experience with the nRF9160/DTLS/x509 is OK.&lt;/p&gt;
&lt;p&gt;&amp;gt; why there&amp;#39;s a discrepancy&lt;/p&gt;
&lt;p&gt;I guess, that&amp;#39;s more a job for Nordic to sync their nrf samples with the zephyr samples ;-).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/510426?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2024 09:12:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e8bd853-c617-496b-949c-e99773bc4230</guid><dc:creator>Scytmo</dc:creator><description>&lt;p&gt;Yes, that works!&amp;nbsp; Thank you so much, Achim - I really appreciate your help :-)&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll also try to work out why there&amp;#39;s a discrepancy in what tag is used, and I&amp;#39;ll raise a separate ticket if/when I find the root cause for that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/510239?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2024 08:53:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3b34698-4649-4066-af30-5d9bd3bcc95c</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;short:&lt;/p&gt;
&lt;p&gt;CONFIG_LWM2M_SECURITY_KEY_SIZE=1500&lt;br /&gt;CONFIG_NRF_MODEM_LIB_TRACE=y&lt;br /&gt;CONFIG_APP_LWM2M_PSK=&amp;quot;&amp;quot;&lt;br /&gt;CONFIG_LWM2M_CLIENT_UTILS_SERVER_TLS_TAG=16842753&lt;/p&gt;
&lt;p&gt;does it on &amp;quot;my machine&amp;quot;.&lt;/p&gt;
&lt;p&gt;long:&lt;/p&gt;
&lt;p&gt;With your detailed description it&amp;#39;s fast and easy to reproduce the failure. To exclude the credentials, I&amp;#39;ve tested them with my own coap-client against leshan, works. Exchanging the CA causes my client to abort the handshake without client certificate. Changing the CA in the lwm2m sample didn&amp;#39;t change the handshake. enable logging showed, that sec_tag 35724861 is used to write the credentials and to configure to the socket ....&lt;/p&gt;
&lt;p&gt;However, the cellular monitor uses 16842753, and so I guess, that somewhere the socket config of lwm2m_engine is overwritten. That&amp;#39;s it. Use 16842753 as sec_tag, and it starts working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/510188?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2024 18:53:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3015051-c711-4886-8ca6-11175556131a</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt; I can&amp;#39;t get X509 to work with LwM2M using the example in the link of my first comment,&lt;/p&gt;
&lt;p&gt;Thanks! I hope the details you provided helps Nordic to check and see the issue.&lt;/p&gt;
&lt;p&gt;In my experience (no lwm2m) using &amp;quot;AT%CMNG&amp;quot; via &amp;quot;modem_key_mgmt_write&amp;quot; works well with x509.&lt;/p&gt;
&lt;p&gt;Do you have a log with CONFIG_LWM2M_CLIENT_UTILS_LOG_LEVEL on DEBUG?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/510172?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2024 16:24:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9795fc85-8b8e-4c5f-bd3f-1dbb30bdfd10</guid><dc:creator>Scytmo</dc:creator><description>&lt;p&gt;Hi Achim,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t get X509 to work with LwM2M using the example in the link of my first comment, so I do not have a working configuration to experiment with - otherwise I would have already done the step-by-step investigation that you suggest (it&amp;#39;s very frustrating that I don&amp;#39;t have a working example).&lt;/p&gt;
&lt;p&gt;I can reproduce my issue from first principles with the following precise steps:&lt;/p&gt;
&lt;p&gt;Generate CA and client keys with the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;openssl ecparam -genkey -name prime256v1 -out ca.key
openssl req -x509 -new -SHA256 -nodes -key ca.key -days 3650 -subj &amp;#39;/O=My Company/CN=My root CA/&amp;#39; -out ca.crt
openssl ecparam -genkey -name prime256v1 -out client.key
openssl req -new -key client.key -subj &amp;#39;/CN=urn:imei:351901930699792/&amp;#39; -out client.csr
openssl x509 -req -SHA256 -CA ca.crt -CAkey ca.key -CAcreateserial -in client.csr -out client.crt
&lt;/pre&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note that this isn&amp;#39;t *exactly* as per the instructions in the article I linked to, because I get an error in this suggested line, which appears to be an attempt to create a certificate in a single line without going via a CSR.&amp;nbsp; So you&amp;#39;ll see my commands above create a CSR then create the client certificate from that.&amp;nbsp; I&amp;#39;m not sure if these are equivalent?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;(the following openssl line from the article I linked to does not work for me, as &amp;#39;-CA&amp;#39; and &amp;#39;-CAkey&amp;#39; are not recognised as options for this command)&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;openssl req -x509 -new -SHA256 -nodes -key client.key -CA ca.crt -CAkey ca.key -subj &amp;#39;/CN=urn:imei:&amp;lt;your_15_digit_imei_goes_here&amp;gt;/&amp;#39; -out client.crt&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I can then build the Nordic `lwm2m_client` sample application from the 2.6.1 SDK, with the following &lt;/span&gt;&lt;span&gt;changes/additions to the prj.conf:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_LWM2M_SECURITY_KEY_SIZE=1500&lt;br /&gt;&lt;/span&gt;&lt;span&gt;CONFIG_NRF_MODEM_LIB_TRACE=y&lt;/span&gt;&lt;br /&gt;&lt;span&gt;CONFIG_APP_LWM2M_PSK=&amp;quot;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I get the server CA for the leshan public server using the following&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;openssl s_client -dtls -connect leshan.eclipseprojects.io:5684 -showcerts&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And I modified main.c from line 275 to set X509 mode with these certs/keys, as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;	if (sizeof(CONFIG_APP_LWM2M_PSK) &amp;gt; 1) {
		/* Write hard-coded PSK key to engine */
		/* First security instance is the right one, because in bootstrap mode, */
		/* it is the bootstrap PSK. In normal mode, it is the server key */
		lwm2m_security_set_psk(0, CONFIG_APP_LWM2M_PSK, sizeof(CONFIG_APP_LWM2M_PSK), true,
				       endpoint_name);
	}
	else {
		const char cert[] =
			&amp;quot;-----BEGIN CERTIFICATE-----\n&amp;quot;
			&amp;quot;MIIBRzCB7gIUR/mT2EVlsjzqzxsSWSWyGVRRfV4wCgYIKoZIzj0EAwIwKjETMBEG\n&amp;quot;
			&amp;quot;A1UECgwKTXkgQ29tcGFueTETMBEGA1UEAwwKTXkgcm9vdCBDQTAeFw0yNDExMTIx\n&amp;quot;
			&amp;quot;NTEwMzJaFw0yNDEyMTIxNTEwMzJaMCMxITAfBgNVBAMMGHVybjppbWVpOjM1MTkw\n&amp;quot;
			&amp;quot;MTkzMDY5OTc5MjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABEtcrseTtAeUv8lX\n&amp;quot;
			&amp;quot;krsZaJ9jyyArugFYxPiZD6FZX8kQBgIfmsJb4OWI0da9oEyLkCBPR94UrBWu1WVI\n&amp;quot;
			&amp;quot;WBro1i8wCgYIKoZIzj0EAwIDSAAwRQIhAN20dtXr8JVaQcYgbiecrUqjMx1ADPN/\n&amp;quot;
			&amp;quot;Ppwg7u6YSQGlAiBdwlO9+lMRYcTZ9rT8kACpvQjobe63Zjmwh9wPOtLnIQ==\n&amp;quot;
			&amp;quot;-----END CERTIFICATE-----\n&amp;quot;;
		const char key[] =
			&amp;quot;-----BEGIN EC PRIVATE KEY-----\n&amp;quot;
			&amp;quot;MHcCAQEEIKAl7+dggEz+YswzwfutuuGisLhta/qGtqY7Gb4tJO1boAoGCCqGSM49\n&amp;quot;
			&amp;quot;AwEHoUQDQgAES1yux5O0B5S/yVeSuxlon2PLICu6AVjE+JkPoVlfyRAGAh+awlvg\n&amp;quot;
			&amp;quot;5YjR1r2gTIuQIE9H3hSsFa7VZUhYGujWLw==\n&amp;quot;
			&amp;quot;-----END EC PRIVATE KEY-----\n&amp;quot;;
		const char CA[] =
			&amp;quot;-----BEGIN CERTIFICATE-----\n&amp;quot;
			&amp;quot;MIICKDCCAc+gAwIBAgIURnwIw3M0mK4G0+tMmUj1PhlQkVMwCgYIKoZIzj0EAwIw\n&amp;quot;
			&amp;quot;aTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGElu\n&amp;quot;
			&amp;quot;dGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEiMCAGA1UEAwwZbGVzaGFuLmVjbGlwc2Vw\n&amp;quot;
			&amp;quot;cm9qZWN0cy5pbzAgFw0yMTA3MDkxNDQ0MTRaGA8yMTIxMDYxNTE0NDQxNFowaTEL\n&amp;quot;
			&amp;quot;MAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVy\n&amp;quot;
			&amp;quot;bmV0IFdpZGdpdHMgUHR5IEx0ZDEiMCAGA1UEAwwZbGVzaGFuLmVjbGlwc2Vwcm9q\n&amp;quot;
			&amp;quot;ZWN0cy5pbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABErD49ZejGF2dVpP8i1x\n&amp;quot;
			&amp;quot;s85aUHJ2PE3XU6nSOtkQ6vZzD1AxBmCiIiGdfsdcgBdVKzGzipIBmn6P2FJf0q5a\n&amp;quot;
			&amp;quot;HtCjUzBRMB0GA1UdDgQWBBTssKYTMXjSRAk/MPTZZal1nxA6fjAfBgNVHSMEGDAW\n&amp;quot;
			&amp;quot;gBTssKYTMXjSRAk/MPTZZal1nxA6fjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49\n&amp;quot;
			&amp;quot;BAMCA0cAMEQCIG7iKVckdsMu9nQQXcvblwOqGXRmO9xxpZiZnGb0oICLAiAWKrzr\n&amp;quot;
			&amp;quot;mac0tYvCDlAfARHDC7mFfKiLbUSIBgroovsH3g==\n&amp;quot;
			&amp;quot;-----END CERTIFICATE-----\n&amp;quot;;


			lwm2m_security_set_certificate(0, cert, sizeof(cert), key, sizeof(key), CA, sizeof(CA));
	}
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If I use the Cellular Monitor to capture a trace a load it into Wireshark, I get the same symptoms that I described earlier (empty certificate sent from the client).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/510114?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2024 13:37:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baa608af-37fc-4e3d-8ae0-b992a8d308f0</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Unfortunately, if you work with encryption, any small change may end up in a completely different behavior.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know, if the procedure in the link of your first comment using openssl works, but I would recommend, that you really exactly test that, step by step.&lt;/p&gt;
&lt;p&gt;If that doesn&amp;#39;t work, you may post your PEMs and how you actually provide them to &amp;quot;lwm2m_security_set_certificate&amp;quot;.&lt;/p&gt;
&lt;p&gt;But I guess, it works. And that means, that any change in your process may cause the error. To locate the cause you will need to apply the changes one by one to see, where it fails. A lot of time, unfortunately.&lt;/p&gt;
&lt;p&gt;But, if the procedure in the link works, no one else will have a chance to see, what you changed to make it failing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/510054?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2024 09:30:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f99fe70-d80f-4a9e-92a5-5f80b5036f04</guid><dc:creator>Scytmo</dc:creator><description>&lt;p&gt;Hi Michal,&lt;/p&gt;
&lt;p&gt;Thanks very much for looking at this.&amp;nbsp; I am passing the certificates as char arrays into&amp;nbsp;lwm2m_security_set_certificate().&amp;nbsp; I create the char arrays using the `xxd` utility (`xxd -i`) from the PEM format files (the `cert.txt` attached to this ticket).&amp;nbsp; I have also checked in the output from AT%CMNG=1 that the sha256 matches that of my PEM file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/509984?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2024 19:33:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:319660a9-2eaa-457c-b1bc-a447ea983a78</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;I had to extend my leave until the end of last week unfortunately.&lt;/p&gt;
&lt;p&gt;How exactly is the certificate passed to the functions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/508997?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2024 16:09:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25533aff-084e-4c6a-8777-47d49d0ce398</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Sorry for the delay, I was out of office.&lt;/p&gt;
&lt;p&gt;I will try to do more debugging on it tomorrow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/508165?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 13:22:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3dea8ac7-49c1-442d-aa1e-930f895ba18c</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;OK. I guess, then you need to wait for Michal and Nordic&amp;#39;s analysis.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/508163?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 13:20:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:591dccd5-485f-4e9b-a177-d19c5060631e</guid><dc:creator>Scytmo</dc:creator><description>&lt;p&gt;My apologies, I misunderstood previously.&lt;/p&gt;
&lt;p&gt;OK, I&amp;#39;ve now extracted the private key as you&amp;#39;ve described (and checked it with the ASN.1 decoder), and load that as the device key (and I&amp;#39;ve double checked that the modem reports the matching sha256 result for that file) but unfortunately I still get the same result of an empty client certificate.&lt;/p&gt;
&lt;p&gt;Once more, thanks for your reply and suggestion - it&amp;#39;s much appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/508154?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 13:00:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb1e2707-80a2-4ce8-a3d9-0c166d3f0f87</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;It&amp;#39;s not about the &amp;quot;EC PARAMS&amp;quot;, it&amp;#39;s about the content of &amp;quot;EC PRIVATE KEY&amp;quot;. Copy the base 64 part to the ASN.1 decoder (address above) and you will see, if it contains the public key as well. And so you may test, if using only the private key works, using the &amp;quot;openssl ec -no_public -in client.key&amp;quot; to extract that. for my test key-pair the output will be:&lt;/p&gt;
&lt;p&gt;-----BEGIN EC PRIVATE KEY-----&lt;br /&gt;MDECAQEEIBh0Zh5RqJf49jVJhYRL6MJsIb2+RlmGGUSobg1jg2iIoAoGCCqGSM49&lt;br /&gt;AwEH&lt;br /&gt;-----END EC PRIVATE KEY-----&lt;/p&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/508151?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 12:49:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a5a8545-a313-489e-bcbe-47cb4b498c05</guid><dc:creator>Scytmo</dc:creator><description>&lt;p&gt;Thanks very much for your reply and your suggestion Achim.&amp;nbsp; As it happens, my certifcate PEM didn&amp;#39;t include the EC PARAMS.&amp;nbsp; However, I&amp;#39;ve now tried it with the EC PARAMS included and I get the same behaviour.&lt;/p&gt;
&lt;p&gt;Also I note that the message from&amp;nbsp;SeppoTakalo in the post I referenced includes the following code snippet, which doesn&amp;#39;t appear to include the EC PARAMS in the key.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	static const char key[] =
		&amp;quot;-----BEGIN EC PRIVATE KEY-----\n&amp;quot;
		&amp;quot;...clip...&amp;quot;
		&amp;quot;-----END EC PRIVATE KEY-----&amp;quot;;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks again for your reply and your suggestion, though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/508027?ContentTypeID=1</link><pubDate>Sun, 27 Oct 2024 09:13:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d93450c6-18ea-451f-9be9-91057d1facff</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Such an empty client certificate is commonly used, if the client is not able to use a certificate with private key matching the parameters in the Certificate Request. But from a first check, the certificate should match, so there may be something else prevent the client from using it, maybe an issue with the private key.&lt;/p&gt;
&lt;p&gt;&amp;gt; I am calling lwm2m_security_set_certificate() where I previously called&amp;nbsp;lwm2m_security_set_psk() and have client certificate, client key, and server root CA certificate in PEM form&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure, if the &amp;quot;client key&amp;quot; in PEM is really the intended one for the lwm2m_security_set_certificate. If you follow dejans openssl instructions, the PEM is rather a key pair than a &amp;quot;private key&amp;quot;, I get:&lt;/p&gt;
&lt;p&gt;-----BEGIN EC PARAMETERS-----&lt;br /&gt;BggqhkjOPQMBBw==&lt;br /&gt;-----END EC PARAMETERS-----&lt;br /&gt;-----BEGIN EC PRIVATE KEY-----&lt;br /&gt;MHcCAQEEIBh0Zh5RqJf49jVJhYRL6MJsIb2+RlmGGUSobg1jg2iIoAoGCCqGSM49&lt;br /&gt;AwEHoUQDQgAEllC1uZ7gFyEYjB/iTN547KsUeqzsSIWLAgCo+2g55PuM0EczbZ8s&lt;br /&gt;fXcqurjcIAMw3TQlkldktbYzfYKqG+SpQw==&lt;br /&gt;-----END EC PRIVATE KEY-----&lt;/p&gt;
&lt;p&gt;and if you pass the to &lt;a title="ASN.1 decoder" href="https://lapo.it/asn1js/"&gt;ASN.1 decoder&lt;/a&gt; you see a a Octet String with 32 bytes (that&amp;#39;s the private key), and a BIT String with 520 bit (that&amp;#39;s the corresponding public key).&lt;/p&gt;
&lt;p&gt;Dejan refer also to use the Cellular Monitor, maybe that handle this. If lwm2m_security_set_certificate is able to handle this, isn&amp;#39;t known by me.&lt;/p&gt;
&lt;p&gt;If you want to check, if that key-pair instead of a pure private key is your issue, you may use&lt;/p&gt;
&lt;pre&gt;&lt;br /&gt;openssl ec -no_public -in client.key&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;to extract the private key only (but still with algorithm identifier). Maybe someone from Nordic points you to the documentation, what&amp;#39;s precisely expected there as parameter.&lt;/p&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/507994?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2024 19:22:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f32b4141-bd42-453b-98c5-a4ccba1e20c6</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Thank you for the information,&lt;/p&gt;
&lt;p&gt;I will look more into it next week.&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: Cannot connect to LwM2M server with X509 DTLS.  Wireshark shows empty client certificate.</title><link>https://devzone.nordicsemi.com/thread/507800?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2024 15:13:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32a3fe60-c281-4266-a9e8-efd294c79b48</guid><dc:creator>Scytmo</dc:creator><description>&lt;p&gt;Just to clarify, this is with SDK 2.6.1 and modem firmware 1.3.6&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>