getting belwo error on giving shutdown
Closed this issue · 2 comments
C:\Python27>python.exe Scripts\zap-cli-script.py shutdown
←[1m←[36m[INFO] ←[0mShutting down ZAP daemon
Traceback (most recent call last):
File "Scripts\zap-cli-script.py", line 11, in
load_entry_point('zapcli==0.9.0', 'console_scripts', 'zap-cli')()
File "C:\Python27\lib\site-packages\click\core.py", line 664, in call
return self.main(*args, **kwargs)
File "C:\Python27\lib\site-packages\click\core.py", line 644, in main
rv = self.invoke(ctx)
File "C:\Python27\lib\site-packages\click\core.py", line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Python27\lib\site-packages\click\core.py", line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Python27\lib\site-packages\click\core.py", line 464, in invoke
return callback(*args, **kwargs)
File "C:\Python27\lib\site-packages\click\decorators.py", line 26, in new_func
return ctx.invoke(f, ctx.obj, *args[1:], **kwargs)
File "C:\Python27\lib\site-packages\click\core.py", line 464, in invoke
return callback(*args, **kwargs)
File "C:\Python27\lib\site-packages\zapcli\cli.py", line 64, in shutdown_zap_d
aemon
zap_helper.shutdown()
File "C:\Python27\lib\site-packages\zapcli\zap_helper.py", line 100, in shutdo
wn
self.zap.core.shutdown(apikey=self.api_key)
File "C:\Python27\lib\site-packages\zapv2\core.py", line 239, in shutdown
return six.next(six.itervalues(self.zap.request(self.zap.base + 'core/actio
n/shutdown/', {'apikey': apikey})))
File "C:\Python27\lib\site-packages\zapv2_init.py", line 159, in _request
data = self.request_api(url, get)
File "C:\Python27\lib\site-packages\zapv2_init.py", line 149, in request
api
return self.session.get(url, params=query, proxies=self.__proxies, verify=Fa
lse)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 488, in reques
t
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 473, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",
))
That looks like the error you would receive if you haven't set the API key. As listed here, you need to set the API key for ZAP in either the commandline parameter --api-key
or in the ZAP_API_KEY
environment variable. Alternatively you can unset the API key using -config api.disablekey=true
when starting ZAP (for example zap-cli start -o '-config api.disablekey=true'
). You can read more about ZAP's API key here.
Thank you very much it worked for me, i have set the environment variable ZAP_API_KEY and it just worked like charm. Thank you very much for the quick reply.