uWSGI https server with systemd socket activation

2

2

I run a https web server, using uWSGI (version 2.0.14-debian; on a raspberry Pi with raspian / debian 9 stretch).

For https, I have the following lines in configuration file:

[uwsgi]
...
protocol = https
https-socket = =0,/etc/ssl/certs/star.chained-certificate.crt,/etc/ssl/private/star.privatekey.pem
...

I provide the port as "--shared-socket 0.0.0.0:443" in my systemd service file. This works as long as I start the uwsgi server as systemd service, but not when socket-activated.

To use socket-activation, I do not specify the shared-socket in the uwsgi.service file. While an incoming request starts the service, no data or request is received by uwsgi and the https request times out.

Looking at the source code (uwsgi_setup_systemd() and uwsgi_bind_sockets()), the socket provided by systemd might be bound as "--socket" and not as "--shared-socket" (which would explain why socket activation works in my hands for http but not for https).

What is the correct way to set-up uWSGI for https and socket-activation?

Al_

Posted 2018-12-29T15:59:32.703

Reputation: 21

No answers