question

Bob141421-1406 avatar image
0 Votes"
Bob141421-1406 asked Sumarigo-MSFT edited

Error: unable to verify the first certificate in nodejs azure queue storage createMessage

I am trying out testing 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 Azurite documentation and have set up self-signed rootCA.pem certificate as written here in Azure Storage Explorer. However when I take my code in a file file.js and run node file.js. It gives me the following error message of "unable to verify the first certificate in nodejs azure queue storage add message". Does anyone know what have I done wrongly?




file.js

 'use strict';
    
    
 const storage = require('azure-storage');
 const queueService = storage.createQueueService("DefaultEndpointsProtocol=https;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=https://127.0.0.1:11000/devstoreaccount1;QueueEndpoint=https://127.0.0.1:11001/devstoreaccount1;");
    
 queueService.messageEncoder = new storage.QueueMessageEncoder.TextBase64QueueMessageEncoder();
    
    
    
 function testing() {
    
   queueService.createMessage('emailv2', "Hello world", (error) => {
     if (error) {
       console.log('Error encountered when enqueueing welcome message', error);
       console.log()
     }
   });
 }
    
    
    
 console.log(testing())


Error message

 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'
 }




azure-storage-explorerazure-queue-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Sumarigo-MSFT avatar image
1 Vote"
Sumarigo-MSFT answered Sumarigo-MSFT edited

@Bob141421-1406 Thanks for raising this question. I am looking into this issue, I also see you have posted a similar query in the SO forum


Kindly let us know if the above helps or you need further assistance on this issue.


Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

Note: Updating the thread to benefit other community members.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.