Some python scrips for demonstrating chap protocol
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

chap-client.py 425B

12345678910111213141516
  1. #!/usr/bin/env python2
  2. import xmlrpc.client
  3. import hashlib
  4. # connects to the XMLRPC Server
  5. s = xmlrpc.client.ServerProxy('http://localhost:8000')
  6. # initalized the login process
  7. key = s.init()
  8. # does the actual authentication
  9. print( s.auth( hashlib.sha256( ( 'Test123' + key ).encode( 'utf-8' ) ).hexdigest() ) )
  10. # tests protected method
  11. print( s.hello() )
  12. # Print list of available methods
  13. print( s.system.listMethods() )