Connecting to a CalDAV Server with cURL

After installing Baikal as a CalDAV/CardDAV server, I tested the connectivity to this server with cURL. I used SSL with a self-signed certificate on the web server, authentification on the CalDAV server was set to DIGEST.

This is being reflected in the cURL request by using –insecure to address the self-signed certificate and –digest for the DIGEST authentification method, when requesting the username:

--request PROPFIND
--header "Content-Type: text/xml"
--header "Brief:t"
--data "<D:propfind xmlns:D='DAV:'><D:prop><D:displayname/></D:prop></D:propfind>"

USERNAME and PASSWORD are eponymous placeholders, the object in the URL path (cal.php/principals/USERNAME) is specific for Baikal server.

The result of this query:

<?xml version="1.0" encoding="utf-8"?>
 xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs=""
    <d:displayname>Ron Metten</d:displayname>
   <d:status>HTTP/1.1 200 OK</d:status>