Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CalDav with NextCloud and self-signed certificate #8

Open
AlexNathan345 opened this issue Feb 22, 2024 · 8 comments
Open

CalDav with NextCloud and self-signed certificate #8

AlexNathan345 opened this issue Feb 22, 2024 · 8 comments

Comments

@AlexNathan345
Copy link

Unfortunately, I'm unable to to use this module with my NextCloud installation as my SSL certificates are self-signed.

Is there a way to allow for self-signed certificates or disabling the check? Or a step-by-step guide on how to set this up successfully with NextCloud?

Thanks very much for your help!

@eouia
Copy link
Member

eouia commented Feb 22, 2024

I'm not experienced with Self-Signed SSL certification. What kind of error or symptom did the module spit out?

@AlexNathan345
Copy link
Author

AlexNathan345 commented Feb 23, 2024

This is the error message I get in the MagicMirror2 log:
23.02.2024 09:11.41.391] [ERROR] FetchError: request to https://XX.XXX.XXX.XX:444/remote.php/dav failed, reason: self-signed certificate
at ClientRequest. (/magicmirror2/modules/MMM-CalDAV/node_modules/node-fetch/lib/index.js:1501:11)
at ClientRequest.emit (node:events:517:28)
at TLSSocket.socketErrorListener (node:_http_client:501:9)
at TLSSocket.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'DEPTH_ZERO_SELF_SIGNED_CERT',
code: 'DEPTH_ZERO_SELF_SIGNED_CERT'

I also tried connecting with http:// but this doesn't work either...

The MM2 config is:
{
module: "MMM-CalDAV", // This module works in background, so position is not needed.
config: {
timeRangeStart: -30, // Get events from 30 days before
timeRangeEnd: 60, // Get events from 60 days from today
servers: [
{ envPrefix: "NEXTCLOUD_",
accountType: 'caldav',
authMethod: 'Basic',
serverUrl: "https://XX.XXX.XXX.XX:444/remote.php/dav",
},
],
}
},
{
module: "calendar",
header: "My upcoming events",
position: "top_left",
config: {
servers: [
{
symbol: "calendar",
url: "http://XX.XXX.XXX.XX:8080/CALDAV/NEXTCLOUD_My_calendar.ics",
auth: { // REQUIRED
user: 'username1', // DEFINED in .env file.
pass: 'password1',
method: 'basic'
},
},
],
}
},

@eouia
Copy link
Member

eouia commented Feb 23, 2024

When you try https://USERNAME:PASSWORD@XX.XXX.XXX.XX:444/remote.php/dav in your browser, what happens?

@AlexNathan345
Copy link
Author

I get this:
This is the WebDAV interface. It can only be accessed by WebDAV clients such as the Nextcloud desktop sync client.

@eouia
Copy link
Member

eouia commented Feb 23, 2024

The error was caused by node-fetch, a dependency of tsdav, which this module depends on. So, I cannot do anything at this moment. Maybe node-fetch seems unable to handle some irregular https certification.
I'll report this error to the node-fetch developers, but I cannot guarantee that it will be fixed soon. Sorry.

@AlexNathan345
Copy link
Author

Thanks very much for looking into this. At least now I know that the error isn't in my config. I might try other certificates at some point but don't really need them for NextCloud as it isn't opened up to the internet. But thanks again.

@eouia
Copy link
Member

eouia commented Feb 23, 2024

Hmmm.. If I have NextCloud, I could look inside more, but atm I have not enough time to install and play with it. When I have some time, I'll research more.

@AlexNathan345
Copy link
Author

All good, don't worry too much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants