Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

535
Views
How do I fix net::ERR_SSL_PROTOCOL_ERROR caused by my js code

I'm currently having an issue when I call certain function repeatedly (ChartData). The code that calls the function is as follows:

  for (let i = 1; i < 3600; i++) {
    setTimeout(function timer() {
      chartserviceApi.ChartData("false").then(responseArr => {
       
        console.log("Here !")
        Chartdata = responseArr.data
        let prpdData = responseArr.data.slice();
        if (Chartdata.length == 0) {
          dataPresent = false;
        }
        if (responseArr.data.find(x => x > 200)) {
          alert('abv 200');
        }

        prpsch1.streamPush(responseArr.data)
        prpdch1.streamPush(prpdData)

        
        const parsedMessage = responseArr.data
        const keys = Object.keys(parsedMessage)
        let dataPackage = parsedMessage[keys[keys.length - 1]]
        console.log(dataPackage)
        //prpsch1.streamPush(dataPackage[0]);
        prpdch1.streamPush(dataPackage[0]);
        prpsch1.consume();
        prpdch1.consume();
        prpsch1.runStream();
        prpdch1.runStream();
      });
    }, 4000);}

The ChartData function is as the following:

import axios from 'axios';
const Chartdata = 0
export default {
  ChartData(param) {
    if (param == "false") {
      console.log("False!")
      return axios.get('https://localhost:3000/api/Sensor/GetSensorDataQ?id=1&isInitiated=false');
    }
    else {
      console.log(param)
      console.log("True!")
      return axios.get('https://localhost:3000/api/Sensor/GetSensorDataQ?id=1&isInitiated=true');
    }
  }

Then I get these errors repeatedly. enter image description here

Can anyone suggest what to do here?

Thanks a lot in advance :)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Change https protocol with http in your url. Because https protocol need ssl certificate.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!