fix `_sign` bug, thx to `sartrism`
This commit is contained in:
parent
77cfcbc2f8
commit
2b65346df0
|
|
@ -477,8 +477,12 @@ class DPT():
|
||||||
self.err_print("cannot get nonce")
|
self.err_print("cannot get nonce")
|
||||||
return False
|
return False
|
||||||
sig_maker = httpsig.Signer(secret=key, algorithm='rsa-sha256')
|
sig_maker = httpsig.Signer(secret=key, algorithm='rsa-sha256')
|
||||||
|
try:
|
||||||
signed_nonce = sig_maker._sign(nonce)
|
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(
|
return self._put_auth(
|
||||||
{"client_id": client_id, "nonce_signed": signed_nonce})
|
{"client_id": client_id, "nonce_signed": signed_nonce})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue