Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'dict' object has no attribute 'newNonce' #9901

Open
loopiajoakim opened this issue Feb 13, 2024 · 0 comments
Open

'dict' object has no attribute 'newNonce' #9901

loopiajoakim opened this issue Feb 13, 2024 · 0 comments

Comments

@loopiajoakim
Copy link

Hello,

I'm using a custom client with the acme library and since an upgrade 1.31.0,1 -> 2.4.0,1 (yes, a long time ago but still a problem) I sometimes get the following error: 'dict' object has no attribute 'newNonce'

This seems to originate from this function in acme/client.py

    def _post(self, *args: Any, **kwargs: Any) -> requests.Response:
        """Wrapper around self.net.post that adds the newNonce URL.

        This is used to retry the request in case of a badNonce error.

        """
        kwargs.setdefault('new_nonce_url', getattr(self.directory, 'newNonce'))
        return self.net.post(*args, **kwargs)

From changelog in version 2.0.0:

acme.messages.Directory now only supports lookups by the exact resource name string in the ACME directory (e.g. directory['newOrder']).

It looks like getattr on self.directory has been replaced in all other parts of this file. Using self.directory['newNonce'] seems to do the trick. Is this a forgotten function or am I simplifying things?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant