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

$order->authorize always returns false for new orders #3

Closed
dondon2d opened this issue Sep 9, 2018 · 2 comments
Closed

$order->authorize always returns false for new orders #3

dondon2d opened this issue Sep 9, 2018 · 2 comments
Labels
question Further information is requested

Comments

@dondon2d
Copy link

dondon2d commented Sep 9, 2018

Is there any way to wait for the authorization to finish? For new orders the script needs to be ran twice to generate the certificates. Thanks!

@fbett fbett added the question Further information is requested label Sep 13, 2018
@fbett
Copy link
Owner

fbett commented Sep 13, 2018

Hi!
Yeah, this library tries not to block the current process.
But the LetsEncrypt servers need some time f.e. to generate the certificate, to check the http auth..
Because of this it is currently necessary to run a script multiple times.

Normally that's not a problem, if there is a cronjob.

But you could try to pause the current process by adding:
sleep(30);
This would halt the process for 30 seconds.

Alternativ:

while(true) {
    if($order->authorized())
        break;
    sleep(30);
}

This would retry, until the order is authorized

But keep in mind:
It would be possible that the LetsEncrypt servers need much more time, f.e. minutes or hours to finish a specific step. This is not specified.

@dondon2d
Copy link
Author

I resolved it by doing something similar (added a timeout and looped) but I appreciate the answer. Thank you!

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

No branches or pull requests

2 participants