Hi @bertrandda,
I have a problem connecting my Nextcloud calendar.
I get the error below when I try to connect my calendar

Below are the Gladys logs
2025-04-16T19:48:56+0200 <error> index.js:43 (CalDAVHandler.config) Error: Bad status: 0
at exports.XMLHttpRequest.request.onreadystatechange (/src/server/services/caldav/node_modules/dav-request/dav.js:3424:27)
at exports.XMLHttpRequest.dispatchEvent (/src/server/services/caldav/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
at setState (/src/server/services/caldav/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
at exports.XMLHttpRequest.handleError (/src/server/services/caldav/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:532:5)
at ClientRequest.errorHandler (/src/server/services/caldav/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:459:14)
at ClientRequest.emit (node:events:518:28)
at emitErrorEvent (node:_http_client:104:11)
at TLSSocket.socketErrorListener (node:_http_client:518:5)
at TLSSocket.emit (node:events:518:28)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at processTicksAndRejections (node:internal/process/task_queues:90:21)
I checked the URL several times, and I did create an application password in Nextcloud.
Could you help me with this issue?
Are you using the internal address (and not a created share link)?
Thanks for your help, but yes, I’m indeed using the internal address.
Hi, without putting the domain, could you show the structure of the URL you use?
Normally it’s something like https://DOMAINE/remote.php/dav
Normally the URL is at the bottom left of the Calendar app in « Calendar settings ». I have the impression that the dialog window you two are talking
Here’s a screenshot of my config
That seems fine, does synchronization work correctly with your phone or a PC client?
I use the calendar only in Nextcloud on my PC browser.
@bertrandda I just did the test — with the same URL I can successfully synchronize my NextCloud calendar with my phone. So no problem with the URL, it works fine.
But it’s still impossible to sync with Gladys
And you don’t have any more logs in Gladys or in Nextcloud. I have some free time tomorrow — we can try to look into it together if you want. Would you be available?
Yes, it must really be a problem on Gladys’ side. Is Home Assistant on the same machine as Gladys? I wonder whether the request is being sent or whether your machine can reach the domain name, because status 0 doesn’t mean anything to me 
I think I’ve understood the problem.
On the Home Assistant side I have an option to verify the SSL certificate which is set to false.
With the option set to true, Home Assistant cannot connect.

My Nextcloud machine is local without a domain name and I use a self-signed certificate.
When I need Nextcloud from outside I have a VPN that allows me to access all the services at home.
So I disabled, as a test, SSL on the Nextcloud side and Gladys is able to connect to the calendar.
1 Like
@bertrandda , do you think it’s possible to add this option to Gladys as well?
I’m without my computer for a few days; I’ll do it when I get back if that works for you.
It’s more complicated than expected. It seems easy at the global Node.js level to disable certificate verification, but I haven’t yet managed to do so for CalDAV requests only. I’ll keep you posted.
2 Likes
@bertrandda I saw that you were using an NPM package that you forked dav-request, which uses the native XMLHttpRequest object
I found that there is a fork of this request module:
https://www.npmjs.com/package/xmlhttprequest-ssl
This fork seems pretty widely used (4.7 million downloads per week!), and supports the attribute « rejectUnauthorized » to disable, it seems, the SSL check
I haven’t tested it but it could do the job!
Well spotted, I’ll try to look into this solution
1 Like
Hi @bertrandda,
Have you managed to make progress on the subject?