Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for FastCGI over TLS #13328

Open
ctr49 opened this issue Feb 5, 2024 · 4 comments
Open

support for FastCGI over TLS #13328

ctr49 opened this issue Feb 5, 2024 · 4 comments
Assignees

Comments

@ctr49
Copy link

ctr49 commented Feb 5, 2024

Description

Currently, php-fpm supports UNIX and TCP socket operation. However, to enhance security (and privacy of data in transit) it might be useful to also have an option for a TLS socket, ideally mTLS, additional to TCP for remote connections.

In such cases, it is already possible to use transparent transport encryption (VPN, or a TLS-tunnel), but php-fpm wouldn't have an idea about it. With integrated TLS support, information from the TLS session (e.g. X.509 attributes) could be used to populate "allowed_clients" or php-fpm's ENV to control further behavior.

Since (optional) OpenSSL support is already present in PHP, it should be relatively trivial to also support a TLS listener - with a bit more work for mTLS and actually making use of TLS session information.

@crrodriguez
Copy link
Contributor

Stunnel should allow you do to this quite easily. maybe even socat..

@bukka
Copy link
Member

bukka commented Feb 5, 2024

I got this on my TODO list already. Stunnel is an option in the meantime but native implementation would be better as you don't need to manage addition service. It would eventually need web server support so you don't stunnel on that side either. Client cert support (mTLS) and PSK (session) support should be of course part of it.

@crrodriguez
Copy link
Contributor

I got this on my TODO list already. Stunnel is an option in the meantime but native implementation would be better as you don't need to manage addition service. It would eventually need web server support so you don't stunnel on that side either. Client cert support (mTLS) and PSK (session) support should be of course part of it.

Since I did not found any formal specification on fastcgi over TLS.. wouldn't *CGI over QUIC make more sense today instead?

@bukka
Copy link
Member

bukka commented Feb 5, 2024

Since I did not found any formal specification on fastcgi over TLS.. wouldn't *CGI over QUIC make more sense today instead?

I would imaging that would be much harder to implement on both FPM and web server. TLS over FastCGI should be relatively straight forward. I wouldn't say it's trivial as it's still quite a bit of work but should be easier than CGI over QUIC which I didn't find any spec for either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants