@lasso-ai/cli 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -214,6 +214,7 @@ async function ensureHostCertificate(onProgress) {
|
|
|
214
214
|
// Check if certificate exists and is trusted
|
|
215
215
|
if (hasCertificate()) {
|
|
216
216
|
const certStatus = hostCertificateStatus();
|
|
217
|
+
console.log(`[Lasso] Certificate exists, trusted: ${certStatus.trusted}`);
|
|
217
218
|
// If certificate exists but is not trusted and mkcert is available, regenerate it
|
|
218
219
|
if (!certStatus.trusted && isMkcertInstalled()) {
|
|
219
220
|
onProgress?.("Regenerating certificate with mkcert for trusted SSL...");
|
|
@@ -231,23 +232,28 @@ async function ensureHostCertificate(onProgress) {
|
|
|
231
232
|
// Try mkcert first - it creates system-trusted certificates
|
|
232
233
|
if (!isMkcertInstalled()) {
|
|
233
234
|
onProgress?.("mkcert not found, installing...");
|
|
235
|
+
console.log("[Lasso] mkcert not found, attempting installation...");
|
|
234
236
|
const installResult = await installMkcert();
|
|
235
237
|
if (!installResult.ok) {
|
|
236
238
|
console.warn(`[Lasso] ${installResult.error}`);
|
|
237
239
|
console.warn("[Lasso] Falling back to OpenSSL (certificate will show as not secure)");
|
|
238
240
|
}
|
|
239
241
|
}
|
|
242
|
+
else {
|
|
243
|
+
console.log("[Lasso] mkcert is installed");
|
|
244
|
+
}
|
|
240
245
|
if (isMkcertInstalled()) {
|
|
241
246
|
try {
|
|
242
247
|
onProgress?.("Creating trusted certificate with mkcert...");
|
|
243
248
|
const mkcertPath = getMkcertPath();
|
|
249
|
+
console.log(`[Lasso] Using mkcert at: ${mkcertPath}`);
|
|
244
250
|
(0, node_child_process_1.execFileSync)(mkcertPath, ["-cert-file", exports.TLS_CERT_FILE, "-key-file", exports.TLS_KEY_FILE, "localhost", "127.0.0.1", "::1", "*.lasso"], { stdio: "ignore" });
|
|
245
251
|
node_fs_1.default.chmodSync(exports.TLS_KEY_FILE, 0o600);
|
|
246
252
|
onProgress?.("✓ SSL certificate ready (trusted)");
|
|
247
253
|
return { ok: true, trusted: true };
|
|
248
254
|
}
|
|
249
255
|
catch (mkcertError) {
|
|
250
|
-
console.warn("[Lasso] mkcert failed, falling back to OpenSSL");
|
|
256
|
+
console.warn("[Lasso] mkcert failed, falling back to OpenSSL:", mkcertError);
|
|
251
257
|
}
|
|
252
258
|
}
|
|
253
259
|
// Fallback to OpenSSL - creates self-signed certificate (not trusted by browsers)
|
|
@@ -276,8 +282,8 @@ function hostCertificateStatus() {
|
|
|
276
282
|
let trusted = false;
|
|
277
283
|
if (hasCertificate()) {
|
|
278
284
|
try {
|
|
279
|
-
const certContent = node_fs_1.default.readFileSync(exports.TLS_CERT_FILE, "utf8");
|
|
280
|
-
// mkcert certificates include "mkcert" in the issuer
|
|
285
|
+
const certContent = node_fs_1.default.readFileSync(exports.TLS_CERT_FILE, "utf8").toLowerCase();
|
|
286
|
+
// mkcert certificates include "mkcert" in the issuer or subject (case-insensitive)
|
|
281
287
|
trusted = certContent.includes("mkcert");
|
|
282
288
|
}
|
|
283
289
|
catch {
|
package/package.json
CHANGED