uwsgilibssl

UWSGI for https configuration is not working


UWSGI Version- 2.0.18

Openssl- 1.0.2k-fips

Python 2.7

Getting Error:

uwsgi: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory

Solution

  • When ever we do pip install uWSGI, It automatically binds to openssl libs.

    But make sure you have installed openssl and openssl-devel package.

    I tried with following versions:

    Python- 3.6

    UWSGI- 2.0.18

    Commands:

    Create Virtual Env and install flask and uWSGI:

    virtualenv -p /usr/bin/python3.6 testing
    source testing/bin/activate
    pip install flask
    pip install uWSGI
    

    Create Certs:

    openssl genrsa -out foobar.key 2048
    openssl req -new -key foobar.key -out foobar.csr
    openssl x509 -req -days 365 -in foobar.csr -signkey foobar.key -out foobar.crt
    

    Create Sample Python file: foobar.py

    def application(env, start_response):
        start_response('200 OK', [('Content-Type','text/html')])
        return [b"Hello World"]
    

    Run uWSGI:

    uwsgi --shared-socket 0.0.0.0:443 --uid roberto --gid roberto --https =0,foobar.crt,foobar.key --wsgi-file foobar.py
    

    Make sure do not get confused with the uWSGI installed in a virtual environment and with root user.

    Follow the documentation:

    https://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html