Make built-in DAV client work with HTTPS

Mar 11, '04 11:09:00AM

Contributed by: rwvawter

The built-in webdav support in OS X can be made to talk to https-enabled webservers by using a wrapper application called stunnel. This program can provide an SSL-encrypted connection to any remote service that is SSL-capable (such as POP3S, IMAPS, HTTPS). Download, compile and install stunnel. You do not need fink to accomplish this, simply unpack, then ./configure && make. In the src directory, a binary stunnel will be created. The examples assume that I have some files on a dav server, and I would normally access them via the url:

https://RemoteServer.com/dav/enabled/path
Save the following configuration file as stunnel.conf:
pid=/tmp/stunnel.pid
foreground=yes
setuid=nobody
setgid=nobody
client=yes
[RemoteServer1]
accept  = 7777
connect = RemoteServer.com:443
Then in the src directory, run:
sudo ./stunnel  /path/to/stunnel.conf
Once stunnel has started, go to the Finder's "Connect to Server" function. Use
http://127.0.0.1:7777/dav/enabled/path
as the server location. You can add additional entries for additional servers, by adding blocks, such as the following, to stunnel.conf:
[Server2]
accept  = 7778
connect = AnotherServer.com:443
Be sure to use different port numbers in the accept line for each service you want to connect to. You'll have the convenience of a DAV filesystem, with SSL protection.

[robg adds: This tip provides more detail than did an earlier version.]

Comments (18)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040303143205326