an internal MD5 implemenation
patch by Maxim Dounin
diff --git a/auto/lib/conf b/auto/lib/conf
index 60e891b..f89d922 100644
--- a/auto/lib/conf
+++ b/auto/lib/conf
@@ -29,6 +29,7 @@
     if [ $USE_OPENSSL = YES ]; then
         have=NGX_HAVE_OPENSSL_MD5_H . auto/have
         have=NGX_OPENSSL_MD5 . auto/have
+        have=NGX_HAVE_MD5 . auto/have
         MD5=YES
         MD5_LIB=OpenSSL
 
diff --git a/auto/lib/md5/conf b/auto/lib/md5/conf
index da1bf1b..2a8f8ad 100644
--- a/auto/lib/md5/conf
+++ b/auto/lib/md5/conf
@@ -14,6 +14,7 @@
         OPENSSL_MD5=NO
     fi
 
+    have=NGX_HAVE_MD5 . auto/have
     CORE_INCS="$CORE_INCS $MD5"
 
     case "$NGX_CC_NAME" in
@@ -51,7 +52,7 @@
             # FreeBSD, Solaris 10
 
             ngx_feature="system md library"
-            ngx_feature_name=
+            ngx_feature_name=NGX_HAVE_MD5
             ngx_feature_run=no
             ngx_feature_incs="#include <md5.h>"
             ngx_feature_path=
@@ -97,17 +98,4 @@
         fi
     fi
 
-    if [ $MD5 != YES ]; then
-cat << END
-
-$0: error: the HTTP cache module requires md5 functions
-from OpenSSL library.  You can either disable the module by using
---without-http-cache option, or install the OpenSSL library into the system,
-or build the OpenSSL library statically from the source with nginx by using
---with-http_ssl_module --with-openssl=<path> options.
-
-END
-        exit 1
-    fi
-
 fi
diff --git a/auto/sources b/auto/sources
index a2af302..07809ba 100644
--- a/auto/sources
+++ b/auto/sources
@@ -52,6 +52,7 @@
            src/core/ngx_file.c \
            src/core/ngx_crc32.c \
            src/core/ngx_murmurhash.c \
+           src/core/ngx_md5.c \
            src/core/ngx_rbtree.c \
            src/core/ngx_radix_tree.c \
            src/core/ngx_slab.c \
diff --git a/auto/summary b/auto/summary
index 8a71cbe..010a5be 100644
--- a/auto/summary
+++ b/auto/summary
@@ -51,6 +51,7 @@
 case $MD5 in
     YES)   echo "  + md5: using $MD5_LIB library" ;;
     NONE)  echo "  + md5 library is not used" ;;
+    NO)    echo "  + using builtin md5 code" ;;
     *)     echo "  + using md5 library: $MD5" ;;
 esac