1

I tried to run my Flask Application on localhost and as well as on my local network's IP address and it ran very well (without SSL).

However, when I tried to run the application with SSL then the web browsers didn't load the page and gives the error:

Your connection is not private : NET::ERR_CERT_INVALID

Methods I have tried but failed:

1. Using Self-signed .pem certificate (Subject Type=CA)

With generated certificate .pem, cert key, and configuring my flask app use it.

openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365 app.run( host='192.168.1.127', port="8282", debug=True, ssl_context=('cert.pem', 'key.pem'), ) 

2. Using Self-signed .crt certificate

With generated certificate .crt, cert key, and configuring my flask app use it.

$ openssl genrsa -des3 -out server.key 1024 $ openssl req -new -key server.key -out server.csr $ cp server.key server.key.org $ openssl rsa -in server.key.org -out server.key $ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt app.run( host='192.168.1.127', port="8282", debug=True, ssl_context=('server.crt', 'server.key') ) 

3. Run Flask with ssl_context='adhoc'

``` app.run( host='192.168.1.127', port="8282", debug=True, ssl_context='adhoc' ) ``` 

I am trying to build a system where multiple raspberry pi are located at different rooms of the house but they are connected to the same home network.

There is the main computer on the same network which acts as a Controller and to implement the system successfully I need to make requests from the controller system to all the Raspberry PI over HTTPS.

Screenshot of browser with "your connection is not private" error message

2

1 Answer 1

2

Its working.

The message connection is not private is misleading. What is actually happening is that the connection is encrypted with a certificate that is not in your chain of trust. Even if it was, I doubt the browser would accept a certificate for an IP address.

In any case, your connection is indeed encrypted.

You don't show the additional details. But you can try to add the generated certificate to your system's chain of trust.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.