2

我正在使用 python 脚本来访问我的 nextcloud 服务器,一切都很酷,没有问题,但我决定使用 SSL 自签名加密 nextcloud,然后我的脚本就完成了…… Nextcloud 在 Apache 中被显示,它有指令

重定向“/”“ https://IP

使所有请求转到 https。

我在 python 中使用 webdav 客户端和这个选项

self.options = {'webdav_login':'user', 'webdav_password':'pass', 'webdav_hostname':  http://ip, 'webdav_root': 'nextcloud/remote.php/webdav'}

这些选项与 http 完美搭配,但是当我尝试使用这些选项向 nextcloud 发出任何请求时,我得到 webdav 异常,例如 RemoteParentNotFound。

我试图将http://ip更改为https://ip,但如果我这样做,pycurl 会引发异常 NotConnection。

有人可以帮我让它工作或推荐我使用 python 上传、删除等到 nextcloud 的任何方法吗?

4

1 回答 1

1

问题解决了。要使 pycurl/webdav.client 成功验证证书,请将其附加到 Linux 中的 /etc/ssl/cert/ca-certificate.crt。

于 2018-08-10T20:22:38.507 回答