Skip to content

Commit 167bfe5

Browse files
committed
Fix acme.sh auto-install: use correct installer URL and flags
The previous install command used an invalid --install-online flag on the wrong URL. Now uses the raw GitHub source with explicit --home path. Better error messages on failure with manual install instructions.
1 parent e20f1a7 commit 167bfe5

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

src/tls.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,35 @@ fn ensure_acme_sh() -> Result<()> {
115115
}
116116

117117
info!("Installing acme.sh...");
118+
let home = dirs::home_dir().context("No home directory")?;
119+
let acme_home = home.join(".acme.sh");
120+
118121
let output = Command::new("sh")
119122
.args([
120123
"-c",
121-
"curl -fsSL https://get.acme.sh | sh -s -- --install-online",
124+
&format!(
125+
"curl -fsSL https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh | sh -s -- --install-online --home {}",
126+
acme_home.display()
127+
),
122128
])
123129
.output()
124130
.context("Failed to install acme.sh. Is curl available?")?;
125131

126132
if !output.status.success() {
127133
let stderr = String::from_utf8_lossy(&output.stderr);
128-
anyhow::bail!("acme.sh install failed: {stderr}");
134+
let stdout = String::from_utf8_lossy(&output.stdout);
135+
anyhow::bail!(
136+
"acme.sh install failed.\n\
137+
You can install it manually: curl https://get.acme.sh | sh\n\
138+
stdout: {stdout}\n\
139+
stderr: {stderr}"
140+
);
129141
}
130142

131143
// Verify it's there now
132-
acme_sh_path().context("acme.sh installed but not found")?;
144+
acme_sh_path().context(
145+
"acme.sh installed but not found. Try installing manually: curl https://get.acme.sh | sh"
146+
)?;
133147
info!("acme.sh installed");
134148
Ok(())
135149
}

0 commit comments

Comments
 (0)