create-react-app application does not support let's encrypt ssl certificate - reactjs

I'm trying to run my react application in dev mode (created using create-react-app) using https with a certificate and key provided by the Let's Encrypt CA. I've verified that the certificate is valid because it works perfectly on my express backend.
I've enabled https along with the cert and key file directories in .env:
HTTPS=true
SSL_CRT_FILE= "./HTTPS/cert.pem"
SSL_KEY_FILE= "./HTTPS/key.pem"
When I try to run the react frontend with the certificate, I get this error:
The certificate "D:\Projects\Web Dev\Hackathon chat website\Hackathon-2023\client\HTTPS\cert.pem" is invalid.
error:03000096:digital envelope routines::operation not supported for this keytype
How can I fix this?

Related

How to download the create-react-app files behind the proxy server?

I am getting this following error message when I enter 'create-react-app' on terminal:
Our proxy team has whitelisted the domain: npmjs.org/ in SSL decryption bypass list.
For the packages to get downloaded, what are the domains and links?
If we get the domains and URL links where packages get downloaded from, our proxy team can whitelist those domains and URL links.
Please do help resolve this issue.
Regards
As mentioned above our proxy team whitelisted the domain in SSL decryption list.

How to force HTTPS with create-react-app on heroku

I'm running a very basic react app on Heroku and would like to force https on the production server, while still running localhost on https. I cannot for the life of me figure out how to do this on Heroku.
SSL and domain has been setup and works fine when I manually enter https:// before the domain. But if I manually type http:// this also works.
How do I redirect all http traffic to https for my react app on Heroko. I would like this to happen:
localhost:3000 still works in development
https is forced on production domain
create-react-app still runs without being "ejected"
Typically I'd set this up on the DNS, but Heroku only allows for a CNAME setup, so I cannot do this on the DNS level. I assume a custom server is required like express, but I cannot find any documentation on how to do this for production while stille working normally in development/localhost.

How to renew Localhost certificate to run localhost in MacOS?

I'm using a React app with HTTPS=true npm start command and until today the App was perfectly running on the localhost. Today I received the following message from Chrome and have no idea how to run the App again. To use my backend APIs, I need to run the app with HTTPS. When I check my certificates, It says that the localhost certificate was expired yesterday.
I tried to Add the current certificate to the system Keychain, tried to generate a key.pem and re-run the localhost. None of those worked for me. How can I run my app again?

React native Google Signin Fail When i will build release apk

I will signin with google it's working but whenever I'll create release build it not working
GoogleErrorcode : DEVELOPERERROR
Please check if Google Play App Signing is enabled from the Google Play Console -> Release Management -> App Signing.
Please try below steps:
1] You have to copy the SHA1 from the 'App signing certificate' section and need to add it to the Firebase projects general settings section.
2] Afterward need to regenerate the json file and add it to the project.
3] Re-generate the apk and the error will get resolved.
If folks are still having this issue and have stumbled across this as i did. Here's what i figured out for my react native android firebase project
THERE ARE MULTIPLE SHA-1's TO ADD IN FIREBASE
1. SHA-1 For Release Variant
This is found in the Keystore file. You would have to add it to your Firebase Console Project Settings
a. Get release variant SHA-1 by running command below from you RN project root
$ cd android && ./gradlew signingReport
b. Add the release SHA-1 from here to your Firebase Console Project Settings
2.SHA-1 After you upload to google play store for testing / prod rollout
a .SHA-1 is found in the left nav of your google playstore console.
Setup -> App signing -> App signing key certificate
b. Add this to your Firebase Console Project Settings
for google sign in to work in testing / prod
Solved by adding release keystore SHA-1 to firebase console.
Use below command to create release SHA-1 and Add it to firebase console:
keytool -list -v -keystore {keystore_name} -alias {alias_name}
Note : Apk not need to create again.
Yesterday same problem occurred to me.
Google has released a new signing service in playstore publish console in which google will signin your app with his keystore. After signing , it will give you a new SHA which you have to add in your firebase account.
see the image for the better understanding
enter image description here
I have got a solution to this problem.
You have to put both SHA key i.e. SHA for debug Keystore file and SHA for release jks file, into the firebase project setting.
Go to: https://console.firebase.google.com/
Now choose your project
Click the setting button near Project Overview
Choose Project Setting
Enter both SHA1 (debug SHA1 and release SHA1) in SHA certificate fingerprint
Save it
Download the google-services.json file
Run npx react-native run-android --variant=release in terminal
It worked for me very well.
After than many time trying i got the solution.
In GoogleSignin.configure i was place android client it, that why i getting the error
Finally i will place the web client id(Here)
GoogleSignin.configure({
iosClientId: 'client ID',
webClientId: 'My Web client ID'
})
There is a new signing service from Google in the Playstore publish console, in which Google will sign your app with his keystore. After signing, it will give you a new SHA, which you need to connect to your Firebase account.
Go to Google play store ->
Release -> Setup -> App Integrity
Copy: SHA-1 certificate fingerprint from "App signing key certificate"
Add this into Firebase Project
Project Setting -> Select your app -> Add Fingerprints and Paste it here

how to provide my valid SSL certificarte to my reactjs app

I just finished a reactjs app for my website and is ready to production mode, I have not figure out how get It working under https mode, this app was developed with create-react-app in a local enviroment, now this app is in my redhat enterprise Linux server, I have googleed but unfortunatelly there is no as much valid or functionally information about it, I already set HTTPS=true in package.json and react-scripts with no result because this process do a self signed certificate, so my problem is to my app must work with my new valid certificate
I appreciate some one Who can helpme, thanks in advance
Passing the SSL certificate is the job of the server, not the react application.

Resources