Guest User

Untitled

a guest
Feb 14th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. curl -k "https://192.168.2.1/api/login?username=admin&password=admin"
  2.  
  3. buffer = BytesIO()
  4. c = pycurl.Curl()
  5. c.setopt(c.URL, 'https://192.168.2.1/api/login?username=admin&password=admin')
  6. c.setopt(c.WRITEDATA, buffer)
  7. c.perform()
  8. c.close()
  9.  
  10. body = buffer.getvalue()
  11. # Body is a byte string.
  12. # We have to know the encoding in order to print it to a text file
  13. # such as standard output.
  14. print(body.decode("iso-8859-1"))
  15.  
  16. pycurl.error, (60, 'server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none')
Add Comment
Please, Sign In to add comment