diff -u --recursive --new-file curl-7.10.8.original/include/curl/curl.h curl-7.10.8.verifydepth/include/curl/curl.h
--- curl-7.10.8.original/include/curl/curl.h	2003-11-01 12:25:51.000000000 +0100
+++ curl-7.10.8.verifydepth/include/curl/curl.h	2003-12-01 20:22:12.000000000 +0100
@@ -694,6 +694,10 @@
      an HTTP or FTP server. */
   CINIT(MAXFILESIZE, LONG, 114),
 
+  /* Set this option to determine the depth to which server SSL certicate
+     check will have to occur. */
+  CINIT(SSL_VERIFYDEPTH, LONG, 115),
+
   CURLOPT_LASTENTRY /* the last unused */
 } CURLoption;
 
diff -u --recursive --new-file curl-7.10.8.original/lib/ssluse.c curl-7.10.8.verifydepth/lib/ssluse.c
--- curl-7.10.8.original/lib/ssluse.c	2003-10-24 22:03:11.000000000 +0200
+++ curl-7.10.8.verifydepth/lib/ssluse.c	2003-12-01 20:32:46.000000000 +0100
@@ -1026,6 +1026,11 @@
     }
   }
 
+  /* Set the SSL server certificate verify depth. */
+  if (data->set.ssl.verifydepth >= 0) {
+    SSL_CTX_set_verify_depth(conn->ssl.ctx, data->set.ssl.verifydepth);
+  }
+
   /* Lets make an SSL structure */
   conn->ssl.handle = SSL_new (conn->ssl.ctx);
   SSL_set_connect_state (conn->ssl.handle);
diff -u --recursive --new-file curl-7.10.8.original/lib/url.c curl-7.10.8.verifydepth/lib/url.c
--- curl-7.10.8.original/lib/url.c	2003-10-31 22:18:01.000000000 +0100
+++ curl-7.10.8.verifydepth/lib/url.c	2003-12-01 20:38:52.000000000 +0100
@@ -313,6 +313,7 @@
    */
   data->set.ssl.verifypeer = TRUE;
   data->set.ssl.verifyhost = 2;
+  data->set.ssl.verifydepth = -1;
 #ifdef CURL_CA_BUNDLE
   /* This is our prefered CA cert bundle since install time */
   data->set.ssl.CAfile = (char *)CURL_CA_BUNDLE;
@@ -1106,6 +1107,12 @@
      */
     data->set.ssl.verifyhost = va_arg(param, long);
     break;
+  case CURLOPT_SSL_VERIFYDEPTH:
+    /*
+     * Set the SSL server certification verify depth.
+     */
+    data->set.ssl.verifydepth = va_arg(param, long);
+    break;
   case CURLOPT_SSL_CTX_FUNCTION:
     /*
      * Set a SSL_CTX callback
diff -u --recursive --new-file curl-7.10.8.original/lib/urldata.h curl-7.10.8.verifydepth/lib/urldata.h
--- curl-7.10.8.original/lib/urldata.h	2003-10-18 22:14:33.000000000 +0200
+++ curl-7.10.8.verifydepth/lib/urldata.h	2003-12-01 20:40:52.000000000 +0100
@@ -148,6 +148,7 @@
   long verifyhost;       /* 0: no verify
                             1: check that CN exists
                             2: CN must match hostname */
+  long verifydepth;      /* SSL server certificate verify depth */
   char *CApath;          /* DOES NOT WORK ON WINDOWS */
   char *CAfile;          /* cerficate to verify peer against */
   char *random_file;     /* path to file containing "random" data */

