I am trying to list and upload a file to nextcloud with node-red
I have tried using the kuehnelbs node/node-red-contrib-nextcloud
I was successful in the listing but uploading gave me an error :
"self signed certificate in certificate chain"
(which I'm looking at now what it is)( I asked the author, but he doesn't answer)
I have also tried to use the Webdav library directly, but it gives me the same error and no results
With webdav i use:
const webdav = global.get("webdav")
const https = global.get("https")
var server = {address:"https://myip/nextcloud/remote.php/webdav/",
user:"",
password:"",
insecure:true,
},
directory = "/"
node.warn(server)
var client = webdav.createClient(
server.address, {
username: server.user,
password: "server.password",
digest: true,
}
);
node.warn({client:client})
node.warn(directory)
const option = {}
if (server.insecure) {
option.agent = https.Agent({ rejectUnauthorized: false })
}
node.warn(option)
msg.directoryItems=client.getDirectoryContents(directory, option)
.then(function (contents) {
node.send({ 'payload': contents })
}, function (error) {
node.error({error: error})
})
return msg
things to note: use windows and node-red 1.0.3
If someone has used nexcloud with node-red or knows how to correct this error, I would appreciate it