Hi,
We are facing an issue where the launch daemons fails to work with the authenticating proxy configured in System Preferences.
We tried both NSURLConnection and NSURLSession APIs and both fails with following error:
Error with NSURLConnection:
Error Domain=kCFErrorDomainCFNetwork Code=311 "There was a problem establishing a secure tunnel through the web proxy server." UserInfo={NSErrorFailingURLStringKey=https://google.com/, NSErrorFailingURLKey=https://google.com/, _kCFStreamErrorCodeKey=-2097, _kCFStreamErrorDomainKey=4, NSLocalizedRecoverySuggestion=Please check your proxy settings.For help with this problem, contact your system administrator., NSLocalizedDescription=There was a problem establishing a secure tunnel through the web proxy server.}
Error with NSURLSession: Error Domain=kCFErrorDomainCFNetwork Code=311 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2097, _kCFStreamErrorDomainKey=4}
Same binary works fine when run as command line tool with this proxy configuration. Credentials are also configured in the System Preferences for the proxy. We do not see "Proxy-Authorization" header added to the request on the proxy server when daemon tries to request for the resource. Do we need to add the header explicitly when NSURLConnection/Session are used from Daemon?
Regards,
Sanjay.