Hello!
My organization uses Azure DevOps pipelines for application deployment, which we have developed a PowerShell module to assist in scanning internal URLs with ZAP This was working well until recently (I can't recall the exact date it stopped due to lack of runs over the holidays) when the Invoke-WebRequest calls from PowerShell fail with the following exception:
Invoke-WebRequest : The request was aborted: The request was canceled.
Upon investigating this further I see this statement in the ZAP logs for each request:
313741 [ZAP-IO-2-8] WARN org.zaproxy.addon.network.internal.handlers.TlsProtocolHandler.AlpnHandlerImpl - ALPN enabled and no protocol negotiated, closing connection.
I am able to drop the ZAP API URL in a browser and it pulls up without issues. Here is my test PowerShell that invokes this error:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$response = Invoke-WebRequest -uri "
https://zap.mydomain.org/"
If I hop into the ZAP Options > Network > Local Servers/Proxies > Proxy Properties and uncheck 'ALPN > Enable TLS ALPN extension' I am able to make connections from PowerShell. As far as I can tell from my PowerShell research it using HTTP/1.1 and I am manually setting the TLS protocol to be 1.2.
What I am looking for here is:
1. Any assistance on what I might need to add/modify in my PowerShell scripts to successfully call the ZAP API.
2. A configuration to add to my zaproxy.conf to disable 'ALPN > Enable TLS ALPN extension' on the main proxy properties until I can figure out how to adapt my the script.
Thank you for any assistance, and please let me know any additional information that I can provide for any assistance.
Thank you!
- Tim