Send to TAXII Server fails with "local variable 'proxy' referenced before assignment" In the configuration scenario below (No Proxy, https):
Example:
Adding a check for HTTP_PROXY before attempting client.setProxy(proxy) solved the problem for me.
@ ~ line 1300
Was
# Setup client authentication and proxy communication
if https:
client.setUseHttps(True)
client.setProxy(proxy)
if akey and lcert and user:
client.setAuthType(tc.HttpClient.AUTH_CERT_BASIC)
client.setAuthCredentials({'key_file': akey, 'cert_file': lcert,
'username': user, 'password': pword})
Is
@ ~ line 1300
# Setup client authentication and proxy communication
if https:
client.setUseHttps(True)
if settings.HTTP_PROXY:
client.setProxy(proxy)
if akey and lcert and user:
client.setAuthType(tc.HttpClient.AUTH_CERT_BASIC)
client.setAuthCredentials({'key_file': akey, 'cert_file': lcert,
'username': user, 'password': pword})
Didn't know if there was a specific reason to not issue client.setProxy after line ~1258 (similar to the identical code block at line 265):
# Get Proxy settings
if settings.HTTP_PROXY:
proxy = settings.HTTP_PROXY
if not proxy.startswith('http://'):
proxy = 'http://' + proxy
# Get Proxy settings
if settings.HTTP_PROXY:
proxy = settings.HTTP_PROXY
if not proxy.startswith('http://'):
proxy = 'http://' + proxy
client.setProxy(proxy)
Send to TAXII Server fails with "local variable 'proxy' referenced before assignment" In the configuration scenario below (No Proxy, https):
Example:
Adding a check for HTTP_PROXY before attempting client.setProxy(proxy) solved the problem for me.
@ ~ line 1300
Was
Is
@ ~ line 1300
Didn't know if there was a specific reason to not issue client.setProxy after line ~1258 (similar to the identical code block at line 265):