Support of HTTPS keyword in PAC file

I've tried several functions for executing a proxy autoconfiguration script to determine the best proxy to use to retrieve a specified URL
Code Block
CFNetworkCopyProxiesForAutoConfigurationScript
CFNetworkExecuteProxyAutoConfigurationURL
CFNetworkExecuteProxyAutoConfigurationScript

And they all seems to ignore HTTPS keyword in PAC file
Code Block
function FindProxyForURL(url, host) {
return "HTTPS ...";
}

That seems to be only way to use HTTPS proxy.

Can someone please confirm this?

Replies

Not sure what is happening here, but if you use SCDynamicStoreCopyProxies to take a look at what the system currently has set for your proxy settings, would this give you any clues?

Code Block swift
guard let systemProxyConfig = SCDynamicStoreCopyProxies(nil) as? [CFString: AnyObject] else {
return nil
}
/* Then look at the following for more clues: */
let httpEnabled = systemProxyConfig[kSCPropNetProxiesHTTPEnable] as? Bool
let httpsEnabled = systemProxyConfig[kSCPropNetProxiesHTTPSEnable] as? Bool
let javascriptPAC = systemProxyConfig[kSCPropNetProxiesProxyAutoConfigJavaScript] as? String


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Thank you for reply, but I'm not dealing with systems proxy settings.
I just want to evaluate some existing PAC file. I think CFNetworkCopyProxiesForAutoConfigurationScript should do the trick, but it ignores HTTP and HTTPS keywords in pac file (it uses only PROXY, DIRECT and SOCKS).

This is still true from what i could find - anyone has a solution to using proxy over TLS? (return HTTPS...; in pac file does not work)