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

183
Views
How can I use https in my Frontend Project in React?

I do all the stuff which I found on stackoverflow.. but it doesn´t work for me..

I will show you an example ..

I do this in my package.json in Frontend :

  "scripts": {
    "start": "set HTTPS=true && react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

And that would be my userAction Login but it doesn´t work:

export const login = (userID, password) => async (dispatch) => {
  try {
    dispatch({ type: USER_LOGIN_REQUEST });

    const url = "https://localhost/authenticate/";
    const response = await axios.post(
      url,
      {
        withCredentials: true,
        headers: {
          Accept: "application/json",
          "Content-Type": "application/json",
        },
      },
      {
        auth: {
          username: userID,
          password,
        },
      }
    );

    const config = {
      auth: {
        username: userID,
        password,
      },
    };

In my backend it would be this way and it works :

###
POST https://localhost:443/authenticate/
Authorization: Basic YWRtaW46MTIz

the error:

POST https://localhost/authenticate/ net::ERR_CERT_INVALID
about 4 years ago · Juan Pablo Isaza
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!