document new Context method and regenerate the docs
diff --git a/doc/html/callbacks.html b/doc/html/callbacks.html
index e43bd99..b1cad1a 100644
--- a/doc/html/callbacks.html
+++ b/doc/html/callbacks.html
@@ -55,7 +55,7 @@
 Python threads to be able to do other things. The real trouble is if you've
 released the thread lock to do a potentially blocking operation, and the
 operation calls a callback. Then we must take the thread lock back<A NAME="tex2html6"
-  HREF="#foot916"><SUP>5</SUP></A>.
+  HREF="#foot921"><SUP>5</SUP></A>.
 </EM></EM></EM>
 <P>
 <EM><EM><EM>There are two solutions to the first problem, both of which are necessary. The
@@ -83,7 +83,7 @@
 <P>
 <BR><HR><H4>Footnotes</H4>
 <DL>
-<DT><A NAME="foot916">... back</A><A
+<DT><A NAME="foot921">... back</A><A
  href="callbacks.html#tex2html6"><SUP>5</SUP></A></DT>
 <DD>I'm
 not sure why this is necessary, but otherwise I get a segmentation violation on
diff --git a/doc/html/intro.html b/doc/html/intro.html
index c7f3797..59655f6 100644
--- a/doc/html/intro.html
+++ b/doc/html/intro.html
@@ -60,9 +60,9 @@
 unfortunately its error handling system does not seem to be finished,
 especially for non-blocking I/O.  I think that much of the reason for this
 is that M2Crypto<A NAME="tex2html1"
-  HREF="#foot876"><SUP>1</SUP></A> is
+  HREF="#foot881"><SUP>1</SUP></A> is
 developed using SWIG<A NAME="tex2html2"
-  HREF="#foot877"><SUP>2</SUP></A>.  This
+  HREF="#foot882"><SUP>2</SUP></A>.  This
 makes it awkward to create functions that e.g. can return both an integer and
 NULL since (as far as I know) you basically write C functions and SWIG makes
 wrapper functions that parses the Python argument list and calls your C
@@ -71,12 +71,12 @@
 <P>
 <BR><HR><H4>Footnotes</H4>
 <DL>
-<DT><A NAME="foot876">... M2Crypto</A><A
+<DT><A NAME="foot881">... M2Crypto</A><A
  href="intro.html#tex2html1"><SUP>1</SUP></A></DT>
 <DD>See <a class="url" href="http://www.post1.com/home/ngps/m2/">http://www.post1.com/home/ngps/m2/</a>
 
 </DD>
-<DT><A NAME="foot877">... SWIG</A><A
+<DT><A NAME="foot882">... SWIG</A><A
  href="intro.html#tex2html2"><SUP>2</SUP></A></DT>
 <DD>See <a class="url" href="http://swig.sourceforge.net/">http://swig.sourceforge.net/</a>
 
diff --git a/doc/html/openssl-connection.html b/doc/html/openssl-connection.html
index b775919..fbc2313 100644
--- a/doc/html/openssl-connection.html
+++ b/doc/html/openssl-connection.html
@@ -50,7 +50,7 @@
 <EM><EM><EM>Connection objects have the following methods:
 </EM></EM></EM>
 <P>
-<dl><dt><b><a name='l2h-137'><tt class='method'>accept</tt></a></b>()
+<dl><dt><b><a name='l2h-138'><tt class='method'>accept</tt></a></b>()
 <dd>
 Call the <tt class="method">accept</tt> method of the underlying socket and set up SSL on the
 returned socket, using the Context object supplied to this Connection object at
@@ -59,25 +59,25 @@
 socket's <tt class="method">accept</tt>.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-138'><tt class='method'>bind</tt></a></b>(<var>address</var>)
+<dl><dt><b><a name='l2h-139'><tt class='method'>bind</tt></a></b>(<var>address</var>)
 <dd>
 Call the <tt class="method">bind</tt> method of the underlying socket.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-139'><tt class='method'>close</tt></a></b>()
+<dl><dt><b><a name='l2h-140'><tt class='method'>close</tt></a></b>()
 <dd>
 Call the <tt class="method">close</tt> method of the underlying socket. Note: If you want
 correct SSL closure, you need to call the <tt class="method">shutdown</tt> method first.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-140'><tt class='method'>connect</tt></a></b>(<var>address</var>)
+<dl><dt><b><a name='l2h-141'><tt class='method'>connect</tt></a></b>(<var>address</var>)
 <dd>
 Call the <tt class="method">connect</tt> method of the underlying socket and set up SSL on the
 socket, using the Context object supplied to this Connection object at
 creation.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-141'><tt class='method'>connect_ex</tt></a></b>(<var>address</var>)
+<dl><dt><b><a name='l2h-142'><tt class='method'>connect_ex</tt></a></b>(<var>address</var>)
 <dd>
 Call the <tt class="method">connect_ex</tt> method of the underlying socket and set up SSL on
 the socket, using the Context object supplied to this Connection object at
@@ -85,119 +85,119 @@
 return 0, SSL won't be initialized.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-142'><tt class='method'>do_handshake</tt></a></b>()
+<dl><dt><b><a name='l2h-143'><tt class='method'>do_handshake</tt></a></b>()
 <dd>
 Perform an SSL handshake (usually called after <tt class="method">renegotiate</tt> or one of
 <tt class="method">set_accept_state</tt> or <tt class="method">set_accept_state</tt>). This can raise the
 same exceptions as <tt class="method">send</tt> and <tt class="method">recv</tt>.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-143'><tt class='method'>fileno</tt></a></b>()
+<dl><dt><b><a name='l2h-144'><tt class='method'>fileno</tt></a></b>()
 <dd>
 Retrieve the file descriptor number for the underlying socket.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-144'><tt class='method'>listen</tt></a></b>(<var>backlog</var>)
+<dl><dt><b><a name='l2h-145'><tt class='method'>listen</tt></a></b>(<var>backlog</var>)
 <dd>
 Call the <tt class="method">listen</tt> method of the underlying socket.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-145'><tt class='method'>get_app_data</tt></a></b>()
+<dl><dt><b><a name='l2h-146'><tt class='method'>get_app_data</tt></a></b>()
 <dd>
 Retrieve application data as set by <tt class="method">set_app_data</tt>.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-146'><tt class='method'>get_cipher_list</tt></a></b>()
+<dl><dt><b><a name='l2h-147'><tt class='method'>get_cipher_list</tt></a></b>()
 <dd>
 Retrieve the list of ciphers used by the Connection object. WARNING: This API
 has changed. It used to take an optional parameter and just return a string,
 but not it returns the entire list in one go.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-147'><tt class='method'>get_context</tt></a></b>()
+<dl><dt><b><a name='l2h-148'><tt class='method'>get_context</tt></a></b>()
 <dd>
 Retrieve the Context object associated with this Connection.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-148'><tt class='method'>get_peer_certificate</tt></a></b>()
+<dl><dt><b><a name='l2h-149'><tt class='method'>get_peer_certificate</tt></a></b>()
 <dd>
 Retrieve the other side's certificate (if any)
 </dl>
 <P>
-<dl><dt><b><a name='l2h-149'><tt class='method'>getpeername</tt></a></b>()
+<dl><dt><b><a name='l2h-150'><tt class='method'>getpeername</tt></a></b>()
 <dd>
 Call the <tt class="method">getpeername</tt> method of the underlying socket.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-150'><tt class='method'>getsockname</tt></a></b>()
+<dl><dt><b><a name='l2h-151'><tt class='method'>getsockname</tt></a></b>()
 <dd>
 Call the <tt class="method">getsockname</tt> method of the underlying socket.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-151'><tt class='method'>getsockopt</tt></a></b>(<var>level, optname</var><big>[</big><var>, buflen</var><big>]</big>)
+<dl><dt><b><a name='l2h-152'><tt class='method'>getsockopt</tt></a></b>(<var>level, optname</var><big>[</big><var>, buflen</var><big>]</big>)
 <dd>
 Call the <tt class="method">getsockopt</tt> method of the underlying socket.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-152'><tt class='method'>pending</tt></a></b>()
+<dl><dt><b><a name='l2h-153'><tt class='method'>pending</tt></a></b>()
 <dd>
 Retrieve the number of bytes that can be safely read from the SSL buffer.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-153'><tt class='method'>recv</tt></a></b>(<var>bufsize</var>)
+<dl><dt><b><a name='l2h-154'><tt class='method'>recv</tt></a></b>(<var>bufsize</var>)
 <dd>
 Receive data from the Connection. The return value is a string representing the
 data received. The maximum amount of data to be received at once, is specified
 by <var>bufsize</var>.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-154'><tt class='method'>renegotiate</tt></a></b>()
+<dl><dt><b><a name='l2h-155'><tt class='method'>renegotiate</tt></a></b>()
 <dd>
 Renegotiate the SSL session. Call this if you wish to change cipher suites or
 anything like that.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-155'><tt class='method'>send</tt></a></b>(<var>string</var>)
+<dl><dt><b><a name='l2h-156'><tt class='method'>send</tt></a></b>(<var>string</var>)
 <dd>
 Send the <var>string</var> data to the Connection.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-156'><tt class='method'>sendall</tt></a></b>(<var>string</var>)
+<dl><dt><b><a name='l2h-157'><tt class='method'>sendall</tt></a></b>(<var>string</var>)
 <dd>
 Send all of the <var>string</var> data to the Connection. This calls <tt class="method">send</tt>
 repeatedly until all data is sent. If an error occurs, it's impossible to tell
 how much data has been sent.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-157'><tt class='method'>set_accept_state</tt></a></b>()
+<dl><dt><b><a name='l2h-158'><tt class='method'>set_accept_state</tt></a></b>()
 <dd>
 Set the connection to work in server mode. The handshake will be handled
 automatically by read/write.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-158'><tt class='method'>set_app_data</tt></a></b>(<var>data</var>)
+<dl><dt><b><a name='l2h-159'><tt class='method'>set_app_data</tt></a></b>(<var>data</var>)
 <dd>
 Associate <var>data</var> with this Connection object. <var>data</var> can be retrieved
 later using the <tt class="method">get_app_data</tt> method.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-159'><tt class='method'>set_connect_state</tt></a></b>()
+<dl><dt><b><a name='l2h-160'><tt class='method'>set_connect_state</tt></a></b>()
 <dd>
 Set the connection to work in client mode. The handshake will be handled
 automatically by read/write.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-160'><tt class='method'>setblocking</tt></a></b>(<var>flag</var>)
+<dl><dt><b><a name='l2h-161'><tt class='method'>setblocking</tt></a></b>(<var>flag</var>)
 <dd>
 Call the <tt class="method">setblocking</tt> method of the underlying socket.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-161'><tt class='method'>setsockopt</tt></a></b>(<var>level, optname, value</var>)
+<dl><dt><b><a name='l2h-162'><tt class='method'>setsockopt</tt></a></b>(<var>level, optname, value</var>)
 <dd>
 Call the <tt class="method">setsockopt</tt> method of the underlying socket.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-162'><tt class='method'>shutdown</tt></a></b>()
+<dl><dt><b><a name='l2h-163'><tt class='method'>shutdown</tt></a></b>()
 <dd>
 Send the shutdown message to the Connection. Returns true if the shutdown
 message exchange is completed and false otherwise (in which case you call
@@ -205,23 +205,23 @@
 readable/writeable.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-163'><tt class='method'>sock_shutdown</tt></a></b>(<var>how</var>)
+<dl><dt><b><a name='l2h-164'><tt class='method'>sock_shutdown</tt></a></b>(<var>how</var>)
 <dd>
 Call the <tt class="method">shutdown</tt> method of the underlying socket.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-164'><tt class='method'>state_string</tt></a></b>()
+<dl><dt><b><a name='l2h-165'><tt class='method'>state_string</tt></a></b>()
 <dd>
 Retrieve a verbose string detailing the state of the Connection.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-165'><tt class='method'>want_read</tt></a></b>()
+<dl><dt><b><a name='l2h-166'><tt class='method'>want_read</tt></a></b>()
 <dd>
 Checks if more data has to be read from the transport layer to complete an
 operation.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-166'><tt class='method'>want_write</tt></a></b>()
+<dl><dt><b><a name='l2h-167'><tt class='method'>want_write</tt></a></b>()
 <dd>
 Checks if there is data to write to the transport layer to complete an
 operation.
diff --git a/doc/html/openssl-context.html b/doc/html/openssl-context.html
index a8d9a19..7be0d1f 100644
--- a/doc/html/openssl-context.html
+++ b/doc/html/openssl-context.html
@@ -194,24 +194,30 @@
 Use the certificate <var>cert</var> which has to be a X509 object.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-133'><tt class='method'>use_certificate_chain_file</tt></a></b>(<var>file</var>)
+<dl><dt><b><a name='l2h-133'><tt class='method'>add_extra_chain_cert</tt></a></b>(<var>cert</var>)
+<dd>
+Adds the certificate <var>cert</var>, which has to be a X509 object, to the
+certificate chain presented together with the certificate.
+</dl>
+<P>
+<dl><dt><b><a name='l2h-134'><tt class='method'>use_certificate_chain_file</tt></a></b>(<var>file</var>)
 <dd>
 Load a certificate chain from <var>file</var> which must be PEM encoded.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-134'><tt class='method'>use_privatekey</tt></a></b>(<var>pkey</var>)
+<dl><dt><b><a name='l2h-135'><tt class='method'>use_privatekey</tt></a></b>(<var>pkey</var>)
 <dd>
 Use the private key <var>pkey</var> which has to be a PKey object.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-135'><tt class='method'>use_certificate_file</tt></a></b>(<var>file</var><big>[</big><var>, format</var><big>]</big>)
+<dl><dt><b><a name='l2h-136'><tt class='method'>use_certificate_file</tt></a></b>(<var>file</var><big>[</big><var>, format</var><big>]</big>)
 <dd>
 Load the first certificate found in <var>file</var>. The certificate must be in the
 format specified by <var>format</var>, which is either <tt class="constant">FILETYPE_PEM</tt> or
 <tt class="constant">FILETYPE_ASN1</tt>. The default is <tt class="constant">FILETYPE_PEM</tt>.
 </dl>
 <P>
-<dl><dt><b><a name='l2h-136'><tt class='method'>use_privatekey_file</tt></a></b>(<var>file</var><big>[</big><var>, format</var><big>]</big>)
+<dl><dt><b><a name='l2h-137'><tt class='method'>use_privatekey_file</tt></a></b>(<var>file</var><big>[</big><var>, format</var><big>]</big>)
 <dd>
 Load the first private key found in <var>file</var>. The private key must be in the
 format specified by <var>format</var>, which is either <tt class="constant">FILETYPE_PEM</tt> or
diff --git a/doc/html/openssl-rand.html b/doc/html/openssl-rand.html
index 6d0f676..0828be8 100644
--- a/doc/html/openssl-rand.html
+++ b/doc/html/openssl-rand.html
@@ -59,14 +59,14 @@
 <dd>
 Mix bytes from <var>string</var> into the PRNG state. The <var>entropy</var> argument is
 (the lower bound of) an estimate of how much randomness is contained in
-<var>string</var>, measured in bytes. For more information, see e.g. <a class="rfc" name="rfcref-1785"
+<var>string</var>, measured in bytes. For more information, see e.g. <a class="rfc" name="rfcref-1792"
 href="http://www.ietf.org/rfc/rfc1750.txt">RFC 1750</a>.
 </dl>
 <P>
 <dl><dt><b><a name='l2h-83'><tt class='function'>egd</tt></a></b>(<var>path</var><big>[</big><var>, bytes</var><big>]</big>)
 <dd>
 Query the Entropy Gathering Daemon<A NAME="tex2html3"
-  HREF="#foot898"><SUP>3</SUP></A> on socket <var>path</var> for <var>bytes</var>
+  HREF="#foot903"><SUP>3</SUP></A> on socket <var>path</var> for <var>bytes</var>
 bytes of random data and and uses <tt class="function">add</tt> to seed the PRNG. The default
 value of <var>bytes</var> is 255.
 </dl>
@@ -102,7 +102,7 @@
 <P>
 <BR><HR><H4>Footnotes</H4>
 <DL>
-<DT><A NAME="foot898">... Daemon</A><A
+<DT><A NAME="foot903">... Daemon</A><A
  href="openssl-rand.html#tex2html3"><SUP>3</SUP></A></DT>
 <DD>See
 <a class="url" href="http://www.lothar.com/tech/crypto/">http://www.lothar.com/tech/crypto/</a>
diff --git a/doc/html/openssl-ssl.html b/doc/html/openssl-ssl.html
index 5aee000..1d9ff6a 100644
--- a/doc/html/openssl-ssl.html
+++ b/doc/html/openssl-ssl.html
@@ -113,7 +113,7 @@
 <dd>
 Factory fucnction that creates a new Connection object given an SSL context and
 a socket <A NAME="tex2html5"
-  HREF="#foot901"><SUP>4</SUP></A> object.
+  HREF="#foot906"><SUP>4</SUP></A> object.
 </dl>
 <P>
 <dl><dt><b>exception <a name='l2h-98'><tt class='exception'>Error</tt></a></b>
@@ -173,7 +173,7 @@
 <P>
 <BR><HR><H4>Footnotes</H4>
 <DL>
-<DT><A NAME="foot901">... socket</A><A
+<DT><A NAME="foot906">... socket</A><A
  href="openssl-ssl.html#tex2html5"><SUP>4</SUP></A></DT>
 <DD>Actually, all that is required is an object that
 <i>behaves</i> like a socket, you could even use files, even though it'd be
diff --git a/doc/html/pyOpenSSL.how b/doc/html/pyOpenSSL.how
index 81a1897..2464192 100644
--- a/doc/html/pyOpenSSL.how
+++ b/doc/html/pyOpenSSL.how
@@ -1 +1 @@
-+++ perl /home/martin/projects/pyOpenSSL/pyOpenSSL-0.6/doc/tools/node2label.pl *.html
++++ perl /home/exarkun/Projects/pyOpenSSL/trunk/doc/tools/node2label.pl *.html