Okay, I think I've isolated the issue. It looks like a bug in the version of curl (and thus libcurl) in my installation:
Code:
CURL distributed with my system (Ubuntu 10.04)
root@hostname:/# curl -vvv --cacert /opt/zimbra/conf/ca/ca.pem https://mail.hostname.com:7071
* About to connect() to mail.hostname.com port 7071 (#0)
* Trying 206.221.217.246... connected
* Connected to mail.hostname.com (206.221.217.246) port 7071 (#0)
* successfully set certificate verify locations:
* CAfile: /opt/zimbra/conf/ca/ca.pem
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: C=US; ST=TX; O=hostname; OU=Zimbra Collaboration Suite; CN=*.hostname.com
* start date: 2011-06-18 03:11:20 GMT
* expire date: 2021-06-15 03:11:20 GMT
* common name: *.hostname.com (matched)
* issuer: C=US; ST=N/A; L=N/A; O=Zimbra Collaboration Suite; OU=Zimbra Collaboration Suite; CN=mail.hostname.com
* SSL certificate verify ok.
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: mail.hostname.com:7071
> Accept: */*
>
< HTTP/1.1 302 Found
< Date: Sat, 18 Jun 2011 03:59:09 GMT
< Expires: Tue, 24 Jan 2000 20:46:50 GMT
< Cache-Control: no-store, no-cache, must-revalidate, max-age=0
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Location: https://mail.hostname.com:7071/zimbraAdmin
< Content-Length: 0
<
* Connection #0 to host mail.hostname.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
Works fine. Now, using the CURL included with zimbra:
root@hostname:/# /opt/zimbra/curl/bin/curl -vvv --cacert /opt/zimbra/conf/ca/ca.pem https://mail.hostname.com:7071
* About to connect() to mail.hostname.com port 7071 (#0)
* Trying 206.221.217.246... connected
* Connected to mail.hostname.com (206.221.217.246) port 7071 (#0)
* successfully set certificate verify locations:
* CAfile: /opt/zimbra/conf/ca/ca.pem
CApath: none
* SSLv3, TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to mail.hostname.com:7071
* Closing connection #0
curl: (35) Unknown SSL protocol error in connection to mail.hostname.com:7071
Immediate failure due to unknown protocol error?
root@hostname:/# curl --version
curl 7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
root@hostname:/# /opt/zimbra/curl/bin/curl --version
curl 7.21.4 (x86_64-unknown-linux-gnu) libcurl/7.21.4 OpenSSL/1.0.0d zlib/1.2.3.3
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: GSS-Negotiate IPv6 Largefile NTLM SSL libz
As you can see, when I use the version of curl included with my OS, it has no issues connecting. But when I use the version of curl included with Zimbra... it immediately chokes and dies, claiming an unknown SSL error.
I don't have a particularly exotic installation, standard settings all throughout, so I don't really understand how I could have what seems to be a bad version of curl but nobody else has reported the issue? The only difference between the two commands is the version of curl used, so I don't really understand what else could be the problem?
Edit: Well, I guess OpenSSL could be the problem too...?