Fix SPICE CA cert not applied: .vv format needs inline ca=, not tls-ca-file=<path>

This commit is contained in:
2026-07-06 22:10:41 +02:00
parent aa5383d826
commit a53e9006a5
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "proxmox-spice-client", "name": "proxmox-spice-client",
"version": "1.0.7", "version": "1.0.8",
"description": "VDI SPICE Client f\u00fcr Proxmox", "description": "VDI SPICE Client f\u00fcr Proxmox",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {
+6 -3
View File
@@ -280,10 +280,13 @@ function buildVVFile(params, vmid, client) {
if (params.password) lines.push(`password=${params.password}`); if (params.password) lines.push(`password=${params.password}`);
if (params.proxy) lines.push(`proxy=${params.proxy}`); if (params.proxy) lines.push(`proxy=${params.proxy}`);
// virt-viewer's .vv format only understands the CA inline via `ca=`, with
// newlines escaped as literal "\n" -- there is no `tls-ca-file=<path>` key,
// so pointing at a temp .pem file was silently ignored and left the
// self-signed cluster CA unverified, failing the TLS handshake.
if (params.ca) { if (params.ca) {
const caPath = path.join(os.tmpdir(), 'proxmox-spice-ca.pem'); const caInline = String(params.ca).replace(/\r\n|\r|\n/g, '\\n');
fs.writeFileSync(caPath, params.ca); lines.push(`ca=${caInline}`);
lines.push(`tls-ca-file=${caPath}`);
} }
if (params['host-subject']) lines.push(`host-subject=${params['host-subject']}`); if (params['host-subject']) lines.push(`host-subject=${params['host-subject']}`);