Getting "unable to verify the first certificate" on Galaxy

I’m trying to fetch some remote data (json) using this code:

async function fetchMETData(){
    try {
        const response = await fetch('', {
            headers: new Headers({ 
                'Content-Type'  : 'application/json',
                'User-Agent'    : 'ANYTHING_WILL_WORK_HERE'
        const METData = await response.json();
        for(var i = 0; i < METData.length; i++){
            let existingData = MetThunderRain.findOne({ date: METData[i].Date });
            if(existingData === undefined){  //check if the new incoming data is already in the DB. undefined means the data is not in the DB
                    date        : METData[i].Date,
                    msgEn       : METData[i].Msg_EN,
                    msgMy       : METData[i].Msg_MY,
                    validFrom   : METData[i].Valid_from,
                    validTo     : METData[i].Valid_to
    } catch (err) {

but there is an error on the console that says:

FetchError: request to failed, reason: unable to verify the first certificate

Tried to search online about this error, and everything is pointing towards the certificate/ssl. This app is currently hosted on Galaxy, and I’ve enabled the Domains & Encryption, as well as Security SSL TLS Protocol Support.

I did use the code below to circumvent this problem while developing on localhost, but won’t implement it on Galaxy for obvious reasons.


Anyone can help point me in the right direction? Why is Galaxy’s default SSL certificate isn’t recognised when fetching data externally?

Hi @dchafiz, can you please open a ticket at with your account details? So we can help you from there.

@hschmaiske I’ve submitted a ticket, and is now being handled by one of your support staff. But why am I getting suggestions like setting my meteor galaxy environment to process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0; ?

From what I understand this is something that is dangerous. I’m only using that setting while developing on localhost. Now I have the aforementioned problem on Galaxy after pushing the code. I’m also getting a suggestion to update my Meteor to at least 1.9. But @hschmaiske, I’m using Meteor version 2.6.1.

Anyone else facing this issue on Galaxy?