How to send requests from React on firebase https to API on Golang on DigitalOcean?

Viewed 32

I've set up an API on Go and deployed it to DigitalOcean. On server, I generated certificates with these commands:

SERVER_CN=my-digital-ocean-address
openssl genrsa -passout pass:1234 -des3 -out ca.key 4096
openssl req -passin pass:1234 -new -x509 -days 3650 -key ca.key -out ca.crt -subj "/CN=${SERVER_CN}"
openssl req -passin pass:1234 -new -x509 -days 3650 -key ca.key -out ca.crt -subj "/CN=localhost"
openssl genrsa -passout pass:1234 -des3 -out server.key 4096
openssl req -passin pass:1234 -new -key server.key -out server.csr -subj "/CN=${SERVER_CN}"
openssl req -passin pass:1234 -new -key server.key -out server.csr -subj "/CN=localhost"
openssl x509 -req -passin pass:1234 -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt
openssl pkcs8 -topk8 -nocrypt -passin pass:1234 -in server.key -out server.pem

So the server is running correctly, and I was able to send requests from Postman. But I don't know how to set up certificates on my React frontend, as it says

The certificate key "/ssl/server.key" is invalid. Passphrase required for encrypted key

Thanks in advance, any help is really appreciated! (as I spent too much time on it)

0 Answers
Related