Fix SPICE CA cert not applied: .vv format needs inline ca=, not tls-ca-file=<path>
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "proxmox-spice-client",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"description": "VDI SPICE Client f\u00fcr Proxmox",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
||||
+6
-3
@@ -280,10 +280,13 @@ function buildVVFile(params, vmid, client) {
|
||||
if (params.password) lines.push(`password=${params.password}`);
|
||||
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) {
|
||||
const caPath = path.join(os.tmpdir(), 'proxmox-spice-ca.pem');
|
||||
fs.writeFileSync(caPath, params.ca);
|
||||
lines.push(`tls-ca-file=${caPath}`);
|
||||
const caInline = String(params.ca).replace(/\r\n|\r|\n/g, '\\n');
|
||||
lines.push(`ca=${caInline}`);
|
||||
}
|
||||
if (params['host-subject']) lines.push(`host-subject=${params['host-subject']}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user