Fix build on BSD by reordering includes

Boost headers fail to compile if "struct ip" is declared when
including them.  Fix build by including Destination.hpp before
any of the BSD pf related headers.
Explicitly link against libboost_system

The indirect dependency on libboost_system works fine as long as
we are building without --as-needed.  With --as-needed, we need
to explicitly link against libboost_system.

Reported by: Julian Taylor
Add --enable-pf switch to configure script
Add autodetection of Linux netfilter and BSD pf.

Automatically detect the right NAT state table API to use.
Using --enable-pf to override autodetection still works, but
is not required anymore.  Remove --enable-pf instructions
from documentation accordingly.
Add explicit configuration example for BSD pf
Fix BSD pf config examples for httpListenPort
Improve OpenSSL and Boost autoconfiguration.

Use more advanced autoconfiguration macros for OpenSSL and Boost.
This allows to pick up the libraries even if they are installed
in other locations than /usr (such as /usr/local on BSD) and to
specify alternative paths using the --with-openssl=/path or
--with-boost=/path switches to configure, respectively.

The downside is that autoconfiguration and build takes longer,
since the Boost macros require libtool.
Improve log4cpp autoconfiguration.
Add missing include for strdup() in test program

Reported by: Julian Taylor
Add missing information on where to obtain LOG4CPP

Reported by: Andrew Wilcox
Ignore libtool
Add autogen.sh to initialize autotools toolchain
Add X509v3 extensions to generated certificates

Add a basic set of standard X509v3 extensions to generated certificates
in Authority Mode in order to satisfy SSL/TLS implementations relying
on these extensions being present.
Generate X509v3 certificates instead of v4

X509_set_version() takes a zero-based X509 version number.
A version argument of 3 means X509 version 4, which causes
compatibility problems on some SSL stacks, since there is
no such thing as X509v4 as of the time of writing.
Copy X509v3 subjectAltName from server certificate

In CA mode, copy the target server certificate's subjectAltName
extension into the generated fake certificate.  This allows to
target servers with a hostname that only matches the subjectAltName,
but not the subject CN.
Parse CN from DN using OpenSSL facilities

Use OpenSSL facilities to parse the CN from the DN.  This allows to
correctly parse certificates which have additional DN components after
the CN, such as "emailAddress".  The manual parsing included additional
components following the CN as part of the common name, which in turn
lead to DNS lookups for malformed domain names such as
"www.example.com/emailAddress=jdoe@example.com.example.org".
Fix wildcard certificate detection

Make the wildcard certificate detection code actually work.
This prevents sslsniff from attempting to resolve wildcard
domain names to IP addresses and then crash after failing.
Off by one error in readAction. For example, let buffer = 'G' and length = 1, when readLine completes offset will also be 1. If we then try to append append(buffer, 2), we'll get a null char in our action, which will cause the SSL_write in HTTPSBridge.cpp to terminate early.

Tested on ubuntu 11.04 with linux 2.6.35.
Fix ASN.1 syntax of tryAgain OCSP response (cf. RFC 2560)
Merge branch 'topic/asneeded' into merged