Commit-archive not working for scp and sftp

When trying to use the set system config-management commit-archive location commands, the errors was (60) SSL peer certificate or SSH remote key was not OK

So after digging and not automatically generating a key, I modified the /opt/vyatta/sbin/vyatta-commit-push.pl file and placed -k in the following section

$cmd = “curl -g -s -S -T $tmp_push_file $uri/$save_file”;

$cmd = “curl -k -g -s -S -T $tmp_push_file $uri/$save_file”;

Once I had done this I was getting a new error
curl: (79) Upload failed: Operation failed (4/-31)

I then discovered I needed to add /~/ for it to work.

set system config-management commit-archive location scp://user:password@IPaddress/~/Downloads/

Hope it helps others who struggled like me!

Thanks @badger72 - Can you confirm what version of Vyos this was with?

The version is VyOS 1.3-rolling-202004230117