title: Error: unable to verify the first certificate in nodejs azure queue storage createMessage
body: <p>I am trying to test my Azure Queue Storage on Azurite emulator on MacOS in a local environment. I wrote a piece of code to send a message, which was to be viewed on Azure Storage Explorer. I am using the https connection string as stated in the <a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite" rel="nofollow noreferrer">Azurite documentation</a> and have set up self-signed <code>rootCA.pem</code> <a href="https://github.com/Azure/Azurite/blob/master/README.md#https-setup" rel="nofollow noreferrer">certificate</a> in Azure Storage Explorer. However when I take my code in a file <code>file.js</code> and run <code>node file.js</code>. It gives me the following error message still. Does anyone know what I have done wrongly? Let me know if more information is required.</p>
  <p><strong>file.js</strong></p>
  <pre><code>'use strict';
  
  
  const storage = require('azure-storage');
  const queueService = storage.createQueueService(&quot;DefaultEndpointsProtocol=https;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=https://127.0.0.1:11000/devstoreaccount1;QueueEndpoint=https://127.0.0.1:11001/devstoreaccount1;&quot;);
  
  queueService.messageEncoder = new storage.QueueMessageEncoder.TextBase64QueueMessageEncoder();
  
  
  
  function testing() {
  
    queueService.createMessage('emailv2', &quot;Hello world&quot;, (error) =&gt; {
      if (error) {
        console.log('Error encountered when enqueueing welcome message', error);
        console.log()
      }
    });
  }
  
  
  
  console.log(testing())
  </code></pre>
  <p><strong>Error message</strong></p>
  <pre><code>Error encountered when enqueueing welcome message Error: unable to verify the first certificate
      at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)
      at TLSSocket.emit (events.js:315:20)
      at TLSSocket._finishInit (_tls_wrap.js:932:8)
      at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12) {
    code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
  }
  </code></pre>