We use a proxy.pac file to redirect connections to blacklisted URLs by PROXY-ing the request to a local server proxy. For example, the proxy.pac file sends requests to https://unwarranted.tracker.website/?whatever to
PROXY http://my.blackhole.server:8119
This has worked for years on Safari iOS, and still works on Safari macOS, but has stopped working for HTTPS requests on all i-devices after updating to Safari on iOS/iPadOS 15. Most requests are HTTPS.
The observed behavior is that Safari 15 bypasses the PROXY and sends requests to https://unwarranted.tracker.website/?whatever.
I hypothesize the reason is that the proxy returns 400 for such HTTPS CONNECT requests. Its behavior, expected for HTTPS CONNECT requests,looks like:
curl -I --proxy http://my.blackhole.server:8119 https://unwarranted.tracker.website/?whatever. HTTP/1.1 400 Bad Request Server: nginx/1.21.3 Date: Sat, 25 Sep 2021 19:17:07 GMT Content-Type: text/html Content-Length: 157 Connection: close
curl: (56) Received HTTP code 400 from proxy after CONNECT
Is bypassing a proxy.pac’s PROXY if the proxy server returns a 400 code expected behavior for Safari iOS?
We would like to be able to block unwanted requests on iOS with a proxy.pac file.