-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
WPAD not working for us!? #43
Comments
What does the actual PAC file look like? Does it actually return a proxy string for that host? It might be worth trying with pypac and seeing what it thinks the proxy string is. |
So just to clarify, WPAD = discovery using DNS/DHCP. It looks like you have set AutoConfigURL = PAC mode and not WPAD. That being said, can you also verify that IE is able to use this PAC file and resolve correctly? |
I have the same error on Windows 7. Pinned it to the usage of WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY which is only supported on Windows 8.1 and newer. |
Too be honest, I'm not sure where PAC starts and WPAD ends (cp. https://en.wikipedia.org/wiki/Web_Proxy_Auto-Discovery_Protocol), so maybe my wording was a little bit inaccurate. But IE works without problems and the PAC file is valid. It should return As we are using Win10, WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY should work for us. I changed to the deprecated version WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, but WinHttpGetProxyForUrl() still gives me the same ERROR_INVALID_HANDLE (6). I've still no idea, what handle this error code is referring to. :-( |
I tried an older version of px (2018-03-03) and pypac seems to work correctly:
|
Maybe I found something related: https://stackoverflow.com/questions/45783063/obtaining-windows-service-handle-in-python Summary: Python 3.6 has some problems with 32/64 Bit Pointers which might lead to problems with ctypes and Win32-APIs on 64 Bit machines. No idea if this can be fixed, maybe this is not related at all!? |
I think I was right. If I explicitly set the
I testet it on 64 Bit Windows 7 and Windows 10 with Python 3.6.3 and 3.6.5. Anyone with a 32 Bit machine and/or an older Python version around to test this? |
I've implemented your fix in the latest release, please verify and close. Thank you! |
The new version works for us. Tested on W7 and W10. Thanks!! |
I'm currently trying to use WPAD/PAC support on Win10 clients and I get the following log:
I tried to debug myself, but was not able to figure out why WinHttpGetProxyForUrl() fails with a ERROR_INVALID_HANDLE (6). The function WinHttpOpen() returns a valid handle! What other handle could be invalid?
I googled for other winhttp+ctypes examples on the web and they fail also! Same error at the same location. Any idea what could be different at our setup!? I can reproduce this on multiple Win10 clients.
I'm a little bit lost now... :-(
The text was updated successfully, but these errors were encountered: