fix `_sign` bug, thx to `sartrism`

This commit is contained in:
HappyZ 2018-11-30 13:31:50 -06:00
parent 77cfcbc2f8
commit 2b65346df0
1 changed files with 6 additions and 2 deletions

View File

@ -477,8 +477,12 @@ class DPT():
self.err_print("cannot get nonce")
return False
sig_maker = httpsig.Signer(secret=key, algorithm='rsa-sha256')
signed_nonce = sig_maker._sign(nonce)
try:
signed_nonce = sig_maker._sign(nonce)
except AttributeError:
signed_nonce = sig_maker.sign(nonce)
except BaseException as e:
print("err:" + str(e))
return self._put_auth(
{"client_id": client_id, "nonce_signed": signed_nonce})