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

fix(dashmate): various ZeroSSL cert verification errors #2339

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,25 +177,40 @@ export default function obtainZeroSSLCertificateTaskFactory(
try {
await verifyDomain(ctx.certificate.id, ctx.apiKey);
} catch (e) {
if (ctx.noRetry !== true) {
retry = await task.prompt({
type: 'toggle',
header: chalk` An error occurred during verification: {red ${e.message}}
// Error: The given certificate is not ready for domain verification
// Sometimes this error means that certificate is already verified
if (e.code === 2831) {
const certificate = await getCertificate(ctx.apiKey, ctx.certificate.id);
// Just proceed on certificate download if we see it's already issued.
if (certificate.status === 'issued') {
return;
}
}

if (e.type === 'domain_control_validation_failed') {
// Retry on this undocumented error whatever it means
await wait(5000);
} else {
shumkov marked this conversation as resolved.
Show resolved Hide resolved
if (ctx.noRetry !== true) {
retry = await task.prompt({
type: 'toggle',
header: chalk` An error occurred during verification: {red ${e.message}}

Please ensure that port 80 on your public IP address ${ctx.externalIp} is open
for incoming HTTP connections. You may need to configure your firewall to
ensure this port is accessible from the public internet. If you are using
Network Address Translation (NAT), please enable port forwarding for port 80
and all Dash service ports listed above.`,
message: 'Try again?',
enabled: 'Yes',
disabled: 'No',
initial: true,
});
}
message: 'Try again?',
enabled: 'Yes',
disabled: 'No',
initial: true,
});
}

if (!retry) {
throw e;
if (!retry) {
throw e;
}
}
}
} while (retry);
Expand Down
Loading