Your script does not handle intermediate certificates correctly. Likely it follows acme-tiny which is also broken in this sense by not returning the link to the intermediate as required by the ACME specification.
You have to work around this by trying to build it later. See diafygi/acme-tiny#77
or diafygi/acme-tiny#111 or diafygi/acme-tiny#115
Without handling this SSL sites will be broken sooner or later when the intermediate is changed (happened before already).
Your script does not handle intermediate certificates correctly. Likely it follows acme-tiny which is also broken in this sense by not returning the link to the intermediate as required by the ACME specification.
You have to work around this by trying to build it later. See diafygi/acme-tiny#77
or diafygi/acme-tiny#111 or diafygi/acme-tiny#115
Without handling this SSL sites will be broken sooner or later when the intermediate is changed (happened before already).