How to run create-react-app on host 0.0.0.0

Viewed 136

Update: I have found the issue to be that create-react-app is never changing the host to 0.0.0.0. This is due to the network I'm running this on at work. If I remove 0.0.0.0 from the flask server, it gives the same errors. It only works with 0.0.0.0 as the hostname in Flask but I can't find any way to run the react server on it. It only ever runs on localhost:3001 and ip:3001, both of which give me errors with https.

I am having trouble launching the sample app from create-react-app and TLS 1.2+ are the only protocols supported on my work network.

I've made an .env file for React as below. However, Chrome says it's not a trusted certificate and won't load. Is there any way to force the protocol used with an env variable?

HTTPS=true
HOST=0.0.0.0
PORT=3001
SSL_CRT_FILE=file.cer
SSL_KEY_FILE=file.key

I had similar problems with my flask server but eventually got it to work as below

def ssl_setup():
  cer_file = file.cer
  key_file = file.key

  context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
  context.load_cert_chain(cer_file, key_file)

if __name__ == "__main__":
  app.run(host='0.0.0.0', port=5001, ssl_context=ssl_setup())

Using chrome dev tools, it shows that Flask is using AES256 while React is using AES128. Maybe this is the issue?

enter image description here

enter image description here

Forcing 256 bit is still not working, it keep saying my certificate is invalid even though it works just fine in Python. To force it I used export NODE_OPTIONS=--tls-cipher-list=''ECDHE-RSA-AES128-GCM-SHA256:!RC4''

0 Answers
Related