0

I am trying to connect to my symantec antivirus, using a post request, but python is throwing an errorw

import requests, json
import certifi, urllib3, httplib

## Setup username/password ##

data = {'username': 'username',
        'password': 'password',
        'domain': ''}

url = 'https://myurlthatuseshttps'

headers = {'Content-Type: application/json'}

r = requests.post(url, cert=('C:\SymantecScriptPython\PythonApplication1\PythonApplication1\symantec1.cer'))


print(r.status_code)



conn.close()

Error: [SSL] PEM lib (_ssl.c:2600)

I am not sure what to do at this point, unless i should use a cert that ends in .pem

davidjbeiler
  • 133
  • 2
  • 15
  • http://docs.python-requests.org/en/master/user/advanced/#client-side-certificates Looks like requests doesn't think your cert is complete. Is it encrypted? Is it both the public and private keys? It may not like having just 1 path in a 1-tuple. – ZuluDeltaNiner Jul 05 '17 at 21:31
  • https://stackoverflow.com/questions/32884500/ssl-with-self-signed-certificate-using-python i found this and i don't think it has all the parts it needs :( since the cert is only .cer and not pem, i assume the pem has more information in it – davidjbeiler Jul 05 '17 at 21:34
  • i am not sure what my path would be '/path/client.key' if im on windows – davidjbeiler Jul 05 '17 at 21:35
  • from the documentation, it looks like the tuple requires the cert and the key. requests.get('https://kennethreitz.org', cert=('/path/client.cert', '/path/client.key')) – Salmaan P Jul 05 '17 at 21:36
  • the key file should be the one used to generate the cer file. – ZuluDeltaNiner Jul 05 '17 at 21:37
  • @HunkDivine how do i do that in dinwos? it specifically says that in the documentation... – davidjbeiler Jul 05 '17 at 21:49

0 Answers0