2

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?

Dutu
  • 21
  • 2
  • Does this answer your question? https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported – Wesley LeMahieu Feb 19 '23 at 23:55

1 Answers1

3

I also ran into a same issue and found the following information.

ECDSA certificates not supported
https://github.com/facebook/create-react-app/issues/12934

create-react-app does not support Let's Encrypt's default key type ECDSA. So you have to use RSA certificates. To generate RSA certificates by certbot, use "--key-type".

certbot certonly --key-type rsa
Yuichi
  • 31
  • 2