<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using SE051 OpenSSL 3.0 Provider with Node.js / Passing URIs vs Reference PEMs (Follow-up to Tic in Smart Cards and Secure Element</title>
    <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Using-SE051-OpenSSL-3-0-Provider-with-Node-js-Passing-URIs-vs/m-p/2366955#M296</link>
    <description>Just looking at the release note/changelog of v20 node.js still doesn't support OpenSSL 3.0 providers. They now just make it clear in the documentation, that they rely on the engine concept (&lt;A href="https://github.com/nodejs/node/pull/53329/changes" target="_blank"&gt;https://github.com/nodejs/node/pull/53329/changes&lt;/A&gt;).&lt;BR /&gt;&lt;BR /&gt;Back then I ended up patching node.js to support key ids. Mainly by using the OSSL_STORE API (&lt;A href="https://docs.openssl.org/3.0/man7/ossl_store/" target="_blank"&gt;https://docs.openssl.org/3.0/man7/ossl_store/&lt;/A&gt;) instead of the PEM function in &lt;A href="https://github.com/nodejs/node/blob/3b19867caaef6b85c65e44dc60274dce2b240d22/src/crypto/crypto_context.cc#L1699" target="_blank"&gt;https://github.com/nodejs/node/blob/3b19867caaef6b85c65e44dc60274dce2b240d22/src/crypto/crypto_context.cc#L1699&lt;/A&gt;. This allowed for loading any key type.&lt;BR /&gt;Of course some adaptions were needed as well in the callers and config structs to match data types, etc.</description>
    <pubDate>Mon, 18 May 2026 13:30:23 GMT</pubDate>
    <dc:creator>tksec</dc:creator>
    <dc:date>2026-05-18T13:30:23Z</dc:date>
    <item>
      <title>Using SE051 OpenSSL 3.0 Provider with Node.js / Passing URIs vs Reference PEMs (Follow-up to Ticket</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Using-SE051-OpenSSL-3-0-Provider-with-Node-js-Passing-URIs-vs/m-p/2366257#M295</link>
      <description>&lt;P&gt;Hello NXP Support Team,&lt;/P&gt;&lt;P&gt;I am following up on a similar issue raised in a previous thread: &lt;A href="https://community.nxp.com/t5/Secure-Authentication/OpenSSL-doesn-t-handle-refpem-key-correctly-nxp-scheme-is/m-p/1866179" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/Secure-Authentication/OpenSSL-doesn-t-handle-refpem-key-correctly-nxp-scheme-is/m-p/1866179&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In that ticket, &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/59276"&gt;@Kan_Li&lt;/a&gt; clarified to &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229340"&gt;@tksec&lt;/a&gt; that the .refpem key format is primarily usable for the legacy OpenSSL engine. However, the questions regarding OpenSSL 3.0 Provider integration with Node.js remained unresolved.&lt;/P&gt;&lt;P&gt;We are developing on an iWave board utilizing the #SE051 Secure Element. We are attempting to establish an mTLS (Client Authentication) connection using a Node.js application and the modern OpenSSL Provider.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Our Environment:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Secure Element:&lt;/STRONG&gt; SE051 variant C&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Middleware / SDK:&lt;/STRONG&gt; Plug &amp;amp; Trust MW v4.7.1&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Hardware Protocol:&lt;/STRONG&gt; Version 7 (SCP03 Enabled)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Node.js Version:&lt;/STRONG&gt; v16.11.1&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;OpenSSL Version:&lt;/STRONG&gt; 3.0.x&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Because OpenSSL 3.0 has deprecated Engines, we are required to use the modern &lt;STRONG&gt;se05x OpenSSL Provider&lt;/STRONG&gt; (libsssProvider.so) instead of the legacy e_sss engine.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Core Issue:&lt;/STRONG&gt; As &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229340"&gt;@tksec&lt;/a&gt; pointed out in the previous thread, Node.js applications use functions like PEM_read_bio_PrivateKey which strictly expect a standard PEM-formatted string/buffer.&lt;/P&gt;&lt;P&gt;The modern OpenSSL 3.0 sssProvider requires the key to be passed as a Direct Provider URI (e.g., "nxp:0x7D000002" or "nxp:/path/to/tls_client_key_ref.pem").&lt;/P&gt;&lt;P&gt;When we attempt to pass this URI into the Node.js https.Agent, the application crashes before the TLS handshake even begins:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;JavaScript&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;const&lt;/SPAN&gt; https = &lt;SPAN class=""&gt;require&lt;/SPAN&gt;(&lt;SPAN class=""&gt;'https'&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;const&lt;/SPAN&gt; agent = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; https.Agent({
    &lt;SPAN class=""&gt;cert&lt;/SPAN&gt;: fs.readFileSync(&lt;SPAN class=""&gt;'device_cert.pem'&lt;/SPAN&gt;),
    &lt;SPAN class=""&gt;key&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"nxp:0x7D000002"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;// Fails: Node.js expects a raw PEM buffer here&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;rejectUnauthorized&lt;/SPAN&gt;: &lt;SPAN class=""&gt;true&lt;/SPAN&gt;
});
&lt;SPAN class=""&gt;// Error: ERR_OSSL_PEM_NO_START_LINE&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Node.js validates the key parameter &lt;I&gt;before&lt;/I&gt; handing it to OpenSSL. Because "nxp:" lacks a -----BEGIN PRIVATE KEY----- header, it aborts immediately.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Our Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Will updating Node.js (e.g., to v18/v20, which natively integrates OpenSSL 3.0) inherently solve this URI parsing issue, or does the Node TLS layer still reject Provider URIs?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Does the NXP provider need to be modified to fix this? Are there any plans or existing solutions to improve the provider code so it can parse legacy .refpem files directly? Allowing high-level languages like Node.js to pass a dummy PEM buffer would completely bypass the URI crashing issue.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thank you for your time and guidance.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 14:03:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Using-SE051-OpenSSL-3-0-Provider-with-Node-js-Passing-URIs-vs/m-p/2366257#M295</guid>
      <dc:creator>AbhijeetG_1215</dc:creator>
      <dc:date>2026-05-15T14:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using SE051 OpenSSL 3.0 Provider with Node.js / Passing URIs vs Reference PEMs (Follow-up to Tic</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Using-SE051-OpenSSL-3-0-Provider-with-Node-js-Passing-URIs-vs/m-p/2366955#M296</link>
      <description>Just looking at the release note/changelog of v20 node.js still doesn't support OpenSSL 3.0 providers. They now just make it clear in the documentation, that they rely on the engine concept (&lt;A href="https://github.com/nodejs/node/pull/53329/changes" target="_blank"&gt;https://github.com/nodejs/node/pull/53329/changes&lt;/A&gt;).&lt;BR /&gt;&lt;BR /&gt;Back then I ended up patching node.js to support key ids. Mainly by using the OSSL_STORE API (&lt;A href="https://docs.openssl.org/3.0/man7/ossl_store/" target="_blank"&gt;https://docs.openssl.org/3.0/man7/ossl_store/&lt;/A&gt;) instead of the PEM function in &lt;A href="https://github.com/nodejs/node/blob/3b19867caaef6b85c65e44dc60274dce2b240d22/src/crypto/crypto_context.cc#L1699" target="_blank"&gt;https://github.com/nodejs/node/blob/3b19867caaef6b85c65e44dc60274dce2b240d22/src/crypto/crypto_context.cc#L1699&lt;/A&gt;. This allowed for loading any key type.&lt;BR /&gt;Of course some adaptions were needed as well in the callers and config structs to match data types, etc.</description>
      <pubDate>Mon, 18 May 2026 13:30:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Using-SE051-OpenSSL-3-0-Provider-with-Node-js-Passing-URIs-vs/m-p/2366955#M296</guid>
      <dc:creator>tksec</dc:creator>
      <dc:date>2026-05-18T13:30:23Z</dc:date>
    </item>
  </channel>
</rss>

