diff -r -u curl-7.28.0/configure.ac curl-7.28.0.dnssec/configure.ac
--- curl-7.28.0/configure.ac	2012-09-08 16:39:18.000000000 -0400
+++ curl-7.28.0.dnssec/configure.ac	2013-01-25 16:11:07.000000000 -0500
@@ -683,6 +683,12 @@
 
 CURL_CHECK_LIB_XNET
 
+AC_CHECK_LIB(val-threads, val_getdaneinfo,
+             [
+             LIBS="$LIBS -lval-threads -lsres -lpthread"
+             AC_DEFINE([HAVE_DNSVAL_DANE], [1], [Perform local DANE Validation using dnsval])
+             ])
+
 dnl gethostbyname without lib or in the nsl lib?
 AC_CHECK_FUNC(gethostbyname,
               [HAVE_GETHOSTBYNAME="1"
diff -r -u curl-7.28.0/lib/sslgen.c curl-7.28.0.dnssec/lib/sslgen.c
--- curl-7.28.0/lib/sslgen.c	2012-08-08 17:38:25.000000000 -0400
+++ curl-7.28.0.dnssec/lib/sslgen.c	2013-01-25 16:11:55.000000000 -0500
@@ -161,6 +161,9 @@
   Curl_safefree(sslc->cipher_list);
   Curl_safefree(sslc->egdsocket);
   Curl_safefree(sslc->random_file);
+#ifdef HAVE_DNSVAL_DANE
+  val_free_dane(sslc->danestatus);
+#endif
 }
 
 #ifdef USE_SSL
diff -r -u curl-7.28.0/lib/ssluse.c curl-7.28.0.dnssec/lib/ssluse.c
--- curl-7.28.0/lib/ssluse.c	2012-10-08 18:35:40.000000000 -0400
+++ curl-7.28.0.dnssec/lib/ssluse.c	2013-01-25 16:25:54.000000000 -0500
@@ -69,6 +69,11 @@
 #include <md5.h>
 #endif
 
+#ifdef HAVE_DNSVAL_DANE
+#include <validator/validator.h>
+#include <validator/val_dane.h>
+#endif
+
 #include "warnless.h"
 #include "curl_memory.h"
 #include "non-ascii.h" /* for Curl_convert_from_utf8 prototype */
@@ -1451,6 +1456,13 @@
 #endif
 #endif
 
+#ifdef HAVE_DNSVAL_DANE
+  int dane_retval;
+  int dane_verify;
+  struct val_daneparams daneparams;
+  struct val_danestatus *danestatus = NULL;
+#endif
+
   DEBUGASSERT(ssl_connect_1 == connssl->connecting_state);
 
   /* Make funny stuff to get random input */
@@ -1699,12 +1711,38 @@
           data->set.str[STRING_SSL_CRLFILE]: "none");
   }
 
+#ifdef HAVE_DNSVAL_DANE
+  /*
+   * Check if a TLSA record is available. If yes, then don't try to
+   * verify the peer at the time of the SSL_connect().
+   */
+  dane_verify = 0;
+  daneparams.port = conn->port;
+  daneparams.proto = DANE_PARAM_PROTO_TCP;
+
+  dane_retval = val_getdaneinfo(NULL, conn->host.name,
+                      &daneparams, &(data->set.ssl.danestatus));
+  if (VAL_DANE_NOERROR == dane_retval) {
+    dane_verify = 1;
+    infof (data, "DANE: TLSA record for %s exists.\n", conn->host.name);
+  } else if (VAL_DANE_IGNORE_TLSA != dane_retval) {
+    /* Error condition */
+    failf(data, "DANE: TLSA record for %s could not be validated.\n",
+            conn->host.name);
+    return CURLE_PEER_FAILED_VERIFICATION;
+  } 
+#endif
+
   /* SSL always tries to verify the peer, this only says whether it should
    * fail to connect if the verification fails, or if it should continue
    * anyway. In the latter case the result of the verification is checked with
    * SSL_get_verify_result() below. */
   SSL_CTX_set_verify(connssl->ctx,
-                     data->set.ssl.verifypeer?SSL_VERIFY_PEER:SSL_VERIFY_NONE,
+                     data->set.ssl.verifypeer 
+#ifdef HAVE_DNSVAL_DANE
+                     && dane_verify == 0 
+#endif
+                     ? SSL_VERIFY_PEER:SSL_VERIFY_NONE,
                      cert_verify_callback);
 
   /* give application a chance to interfere with SSL set up. */
@@ -2460,6 +2498,26 @@
   }
 #endif
 
+#ifdef HAVE_DNSVAL_DANE
+  /* 
+   * Check if we can validate the cert through the DANE protocol
+   */
+  if (data->set.ssl.danestatus) {
+    int do_certchk = 1;
+    if (VAL_DANE_NOERROR != val_dane_check(NULL, connssl->handle, 
+                    data->set.ssl.danestatus, &do_certchk)) {
+      connssl->connecting_state = ssl_connect_done;
+      return CURLE_PEER_FAILED_VERIFICATION;
+    }
+    infof (data, "DANE: SSL certificate verified using DANE.\n");
+    if (do_certchk == 0) {
+        infof (data, "DANE: Skipping additional ceritificate checks.\n");
+        connssl->connecting_state = ssl_connect_done;
+        return CURLE_OK;
+    }
+  }
+#endif
+
   /*
    * We check certificates to authenticate the server; otherwise we risk
    * man-in-the-middle attack; NEVERTHELESS, if we're told explicitly not to
diff -r -u curl-7.28.0/lib/urldata.h curl-7.28.0.dnssec/lib/urldata.h
--- curl-7.28.0/lib/urldata.h	2012-09-09 08:46:58.000000000 -0400
+++ curl-7.28.0.dnssec/lib/urldata.h	2013-01-25 16:12:06.000000000 -0500
@@ -150,6 +150,11 @@
 #include <netinet/in.h>
 #endif
 
+#ifdef HAVE_DNSVAL_DANE
+#include <validator/validator.h>
+#include <validator/val_dane.h>
+#endif
+
 #include "timeval.h"
 
 #ifdef HAVE_ZLIB_H
@@ -354,6 +359,10 @@
   char *password; /* TLS password (for, e.g., SRP) */
   enum CURL_TLSAUTH authtype; /* TLS authentication type (default SRP) */
 #endif
+
+#ifdef HAVE_DNSVAL_DANE
+  struct val_danestatus *danestatus;
+#endif
 };
 
 /* information stored about one single SSL session */
