how to build uWSGI with SSL support to use the websocket handshake API function?

ε祈祈猫儿з 提交于 2019-11-30 18:25:04
John Wheeler

I had to install OpenSSL via brew. Then run this command.

CFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" UWSGI_PROFILE_OVERRIDE=ssl=true pip install uwsgi -Iv

As one of the poster's below mentioned, you'll need the openssl headers, and if they're in a non-traditional place (for example on Mac OS-X) you have to let uWSGI know.

On Debian/Ubuntu install them with "apt-get install libssl-dev". They'll go in /usr/include/" which is part of UWSGI's automatic path. You should be done.

Mac OS-X El Capitan (10.11) removed the openssl headers. You can check common places with this command--they may have been installed by a package manager like brew or macports.

find /usr/local/include /usr/include /opt/local/include /usr/local/ssl/include -name openssl -type d 2> /dev/null

If that command returns nothing, you'll need to install the headers. You can install them with MacPorts (port install openssl) which will put them in /opt/local/include with a link in /usr/local/include. You can also install them directly, by downloading and untarballing openssl, running "./Configure darwin64-x86_64-cc", then "make", and finally "sudo make install".

Xcode's build utilities package a whole pre-defined build environment. With XCode projects that means developers have a common base to work from, and anything not in the base must be in XCode project. Building open source projects outside the base, gets a bit messy because dependencies like openssl live outside the base directories. You can give uwsgi's build chain ONE include directory to use. It doesn't support the PATH style : separator.

In most install cases, the following should work on OpenSSL.

UWSGI_INCLUDES=/usr/local/include/ pip install uwsgi  

just install openssl development headers (libssl-dev) and rebuild uwsgi (its build system will automatically detect ssl availability)

I fixed my version of this issue by installing uwsgi through pip (outside venv), and changing the init script (Ubuntu) /etc/init.d/uwsgi to run the newly installed 2.x branch (instead of 1.9).

Pip installed to /user/local/bin, so I changed the line daemon to: DAEMON="/usr/local/bin/uwsgi"

You can specify the location of the development headers with LDFLAGS. As an aside, this can happen on OS X as well due to El Capitan no longer shipping headers.

LDFLAGS="-L/usr/local/lib" pip install uwsgi --no-use-wheel
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!