<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>quasiroot</title>
	<atom:link href="http://quasiroot.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://quasiroot.wordpress.com</link>
	<description>adventures in VPS land</description>
	<lastBuildDate>Wed, 08 Aug 2007 21:30:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='quasiroot.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>quasiroot</title>
		<link>http://quasiroot.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://quasiroot.wordpress.com/osd.xml" title="quasiroot" />
	<atom:link rel='hub' href='http://quasiroot.wordpress.com/?pushpress=hub'/>
		<item>
		<title>SSL reactivated for PostgreSQL 8.1</title>
		<link>http://quasiroot.wordpress.com/2007/08/08/ssl-reactivated-for-postgresql-81/</link>
		<comments>http://quasiroot.wordpress.com/2007/08/08/ssl-reactivated-for-postgresql-81/#comments</comments>
		<pubDate>Wed, 08 Aug 2007 21:30:38 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/08/08/ssl-reactivated-for-postgresql-81/</guid>
		<description><![CDATA[I&#8217;ve used the following procedure for allowing SSL connections between PostgreSQL interactive terminals and the server. The organization of keys and certificates is roughly as was documented earlier. 1) Created CA root key and self-signed certificate on iMac &#60;MACUSER&#62;$ mkdir tmp.ca &#60;MACUSER&#62;$ cd tmp.ca &#60;MACUSER&#62;$ openssl req -new -x509 -out ca.crt -keyout ca.pem -days 365 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=34&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve used the following procedure for allowing SSL connections between PostgreSQL interactive terminals and the server. The organization of keys and certificates is roughly as was documented <a href="http://quasiroot.wordpress.com/2007/07/26/certificate-zoo/">earlier</a>.</p>
<p>1) Created CA root key and self-signed certificate on iMac</p>
<pre>&lt;MACUSER&gt;$ mkdir tmp.ca
&lt;MACUSER&gt;$ cd tmp.ca

&lt;MACUSER&gt;$ openssl req -new -x509 -out ca.crt -keyout ca.pem -days 365
Generating a 1024 bit RSA private key
Enter PEM pass phrase: &lt;PASSPHRASE1&gt;
Verifying - Enter PEM pass phrase: &lt;PASSPHRASE1&gt;
Country Name (2 letter code) [AU]: &lt;BLANKS&gt;
State or Province Name (full name) [Some-State]: &lt;BLANK&gt;
Locality Name (eg, city) []: &lt;BLANK&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]: &lt;BLANK&gt;
Organizational Unit Name (eg, section) []: &lt;BLANK&gt;
Common Name (eg, YOUR name) []: ca
Email Address []: &lt;BLANK&gt;

&lt;MACUSER&gt;$ chmod go-rwx ca.pem</pre>
<p>2) Created database server and client keys and certificates on iMac</p>
<pre>&lt;MACUSER&gt;$ openssl req -new -text -out pg_server.req -keyout pg_server.pem -days 365
Enter PEM pass phrase: &lt;PASSPHRASE2&gt;
Verifying - Enter PEM pass phrase: &lt;PASSPHRASE2&gt;
Country Name (2 letter code) [AU]:   &lt;BLANKS&gt;
State or Province Name (full name) [Some-State]:  &lt;BLANK&gt;
Locality Name (eg, city) []:  &lt;BLANK&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:  &lt; BLANK&gt;
Organizational Unit Name (eg, section) []:  &lt;BLANK&gt;
Common Name (eg, YOUR name) []:  pg_server
Email Address []:  &lt;BLANK&gt;
A challenge password []: &lt;EMPTY&gt;
An optional company name []: &lt;EMPTY&gt;

&lt;MACUSER&gt;$ openssl req -new -text -out pg_client.req -keyout pg_client.pem -days 365
Enter PEM pass phrase: &lt;PASSPHRASE3&gt;
Verifying - Enter PEM pass phrase: &lt;PASSPHRASE3&gt;
Country Name (2 letter code) [AU]:  &lt;EMPTY&gt;
State or Province Name (full name) [Some-State]: &lt;EMPTY&gt;
Locality Name (eg, city) []: &lt;EMPTY&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]: &lt;EMPTY&gt;
Organizational Unit Name (eg, section) []: &lt;EMPTY&gt;
Common Name (eg, YOUR name) []: pg_client
Email Address []: &lt;EMPTY&gt;
A challenge password []: &lt;EMPTY&gt;
An optional company name []: &lt;EMPTY&gt;

&lt;MACUSER&gt;$ openssl x509 -req -in pg_server.req -out pg_server.crt \\
  -CA ca.crt -CAkey ca.pem -set_serial 0
Enter pass phrase for ca.pem: &lt;PASSPHRASE1&gt;

&lt;MACUSER&gt;$ openssl x509 -req -in pg_client.req -out pg_client.crt \\
  -CA ca.crt -CAkey ca.pem -set_serial 0
Enter pass phrase for ca.pem: &lt;PASSPHRASE1&gt;

&lt;MACUSER&gt;$ rm pg_server.req pg_client.req
&lt;MACUSER&gt;$ chmod go-rwx pg_server.pem pg_client.pem</pre>
<p>3) Copied all keys and certificates to permanent location</p>
<pre>&lt;MACUSER&gt;$ sudo su -
root# mkdir /etc/ssl
root# mkdir /etc/ssl/certs
root# mkdir /etc/ssl/certs
root# mv ~&lt;MACUSER&gt;/tmp.ca/*.pem /etc/ssl/private/
root# mv ~&lt;MACUSER&gt;/tmp.ca/*.crt /etc/ssl/certs/
root# exit

&lt;MACUSER&gt;$ rm -fr ~/tmp.ca</pre>
<p>4) Copied select keys and certificates to Debian VPS</p>
<pre>guava$ mkdir tmp.ca

&lt;MACUSER&gt;$ cd  /etc/ssl/private/
&lt;MACUSER&gt;$ scp pg_server.pem pg_client.pem \\
  guava@&lt;VPS&gt;.vps.budgetdedicated.com:tmp.ca
&lt;MACUSER&gt;$ cd  /etc/ssl/certs
&lt;MACUSER&gt;$ scp ca.crt pg_server.crt pg_client.crt \\
  guava@&lt;VPS&gt;.vps.budgetdedicated.com:tmp.ca</pre>
<p>5) Added two lines to <em>/etc/postgresql/8.1/main/pg_hba.conf</em></p>
<pre>hostssl guava guava 127.0.0.1/32      md5
hostssl guava guava ::1/128           md5</pre>
<p>6) Installed (unencrypted) key and certificate into PostgreSQL 8.1 server</p>
<pre>guava$ su
root# cd /var/lib/postgresql/8.1/main/
root# mv root.crt root.crt.save
root# mv server.key server.key.save
root# mv server.crt server.crt.save
root# cp ~guava/tmp.ca/ca.crt root.crt
root# cp ~guava/tmp.ca/pg_server.pem server.pem
root# cp ~guava/tmp.ca/pg_server.crt server.crt

root# openssl rsa -in server.pem -out server.key
Enter pass phrase for server.pem: &lt;PASSPHRASE2&gt;
root# chmod og-rwx server.key
root# rm server.pem
root# chown postgres root.crt server.key server.crt
root# chgrp postgres root.crt server.key server.crt

root# /etc/init.d/postgresql-8.1 restart
root# exit
guava$
postgres# psql guava
postgres=# \\q</pre>
<p>7) Installed (unencrypted) key and certificate into PostgreSQL interactive console</p>
<pre>guava$ mkdir ~/.postgresql
guava$ cd ~/.postgresql
guava$ cp ~/tmp.ca/ca.crt root.crt
guava$ cp ~/tmp.ca/pg_client.pem postgresql.pem
guava$ cp ~/tmp.ca/pg_client.crt postgresql.crt

guava$ openssl rsa -in postgresql.pem -out postgresql.key
Enter pass phrase for postgresql.pem: &lt;PASSPHRASE3&gt;
guava$ chmod og-rwx postgresql.key
guava$ rm postgresql.pem</pre>
<p>8) Performed santity check as ahead simulation of SSL client and server authentication</p>
<pre>(sanity check before SSL server authentication)
guava$ su
root# openssl verify -CAfile ~guava/.postgresql/root.crt \\
  /var/lib/postgresql/8.1/main/server.crt
/var/lib/postgresql/8.1/main/server.crt: OK

(sanity check before SSL client authentication)
root# openssl verify -CAfile /var/lib/postgresql/8.1/main/root.crt \\
  ~guava/.postgresql/postgresql.crt
~guava/.postgresql/postgresql.crt: OK</pre>
<p>9) And that was it &#8230;</p>
<pre>root# exit
guava$ psql -h localhost guava
Password: &lt;GUAVA_DATABASE_PASSWORD&gt;
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
guava=&gt; \\q</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=34&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/08/08/ssl-reactivated-for-postgresql-81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>
	</item>
		<item>
		<title>Informal benchmark</title>
		<link>http://quasiroot.wordpress.com/2007/08/03/informal-benchmark/</link>
		<comments>http://quasiroot.wordpress.com/2007/08/03/informal-benchmark/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 19:49:33 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/08/03/informal-benchmark/</guid>
		<description><![CDATA[I&#8217;ve run an informal benchmark for comparing the relative speeds of the virtual private server and my iMac G5 at home. As can be seen from the plot, the iMac (2 GHz PowerPC) wins throughout and by up to a factor of 2. The horizontal axis corresponds to the range of algorithms participating in openssl [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=31&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve run an informal <a href="http://www.openssl.org/docs/apps/speed.html">benchmark</a> for comparing the relative speeds of the virtual private server and my iMac G5 at home. As can be seen from the plot, the iMac  (2 GHz PowerPC) wins throughout and by up to a factor of 2. The horizontal axis corresponds to the range of algorithms participating in <em>openssl speed</em> measurements.</p>
<p><img src="http://quasiroot.files.wordpress.com/2007/08/benchmark2.jpg?w=480" alt="benchmark2.jpg" /></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=31&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/08/03/informal-benchmark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>

		<media:content url="http://quasiroot.files.wordpress.com/2007/08/benchmark2.jpg" medium="image">
			<media:title type="html">benchmark2.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>A couple of (security) updates</title>
		<link>http://quasiroot.wordpress.com/2007/08/03/a-couple-of-security-updates/</link>
		<comments>http://quasiroot.wordpress.com/2007/08/03/a-couple-of-security-updates/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 06:44:59 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/08/03/a-couple-of-security-updates/</guid>
		<description><![CDATA[So far, I have been trusting Debian (security) updates rather blindly, but in the future I&#8217;d prefer a simple tool for inspecting changelogs or similar on what&#8217;s being specifically addressed &#8230; # aptitude update # aptitude --show-versions upgrade The following packages will be upgraded: bind9-host [1:9.3.4-2 -&#62; 1:9.3.4-2etch1] dnsutils [1:9.3.4-2 -&#62; 1:9.3.4-2etch1] file [4.17-5etch1 -&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=30&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So far, I have been trusting Debian (security) updates rather blindly, but in the future I&#8217;d prefer a simple tool for inspecting <a href="http://packages.debian.org/changelogs/pool/main/b/bind9/current/changelog">changelogs</a> or <a href="http://packages.qa.debian.org/b/bind9.html">similar</a> on what&#8217;s being specifically addressed &#8230;</p>
<pre># aptitude update
# aptitude --show-versions upgrade
The following packages will be upgraded:
  bind9-host [1:9.3.4-2 -&gt; 1:9.3.4-2etch1]
  dnsutils [1:9.3.4-2 -&gt; 1:9.3.4-2etch1] file [4.17-5etch1 -&gt; 4.17-5etch2]
  libbind9-0 [1:9.3.4-2 -&gt; 1:9.3.4-2etch1]
  libdns22 [1:9.3.4-2 -&gt; 1:9.3.4-2etch1]
  libisc11 [1:9.3.4-2 -&gt; 1:9.3.4-2etch1]
  libisccc0 [1:9.3.4-2 -&gt; 1:9.3.4-2etch1]
  libisccfg1 [1:9.3.4-2 -&gt; 1:9.3.4-2etch1]
  liblwres9 [1:9.3.4-2 -&gt; 1:9.3.4-2etch1]
  libmagic1 [4.17-5etch1 -&gt; 4.17-5etch2]</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=30&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/08/03/a-couple-of-security-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>
	</item>
		<item>
		<title>Upgrade from PostgreSQL 7.4 to 8.1</title>
		<link>http://quasiroot.wordpress.com/2007/08/03/upgrade-from-postgresql-74-to-81/</link>
		<comments>http://quasiroot.wordpress.com/2007/08/03/upgrade-from-postgresql-74-to-81/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 06:19:45 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/08/03/upgrade-from-postgresql-74-to-81/</guid>
		<description><![CDATA[I had mistakenly thought that Debian package postgresql was an &#8220;alias&#8221; for the most recent version of the database server, but evidently it contains support functions specifically for 7.x versions, and hence my earlier install only led to PostgreSQL 7.4. I should therefore be able to upgrade and use PostgresSQL 8.1 under Debian 4.0 after [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=16&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had mistakenly thought that Debian package <em>postgresql</em> was an &#8220;alias&#8221; for the most recent version of the database server, but evidently it contains support functions specifically for 7.x versions, and hence my earlier install only led to PostgreSQL 7.4. I should therefore be able to <a href="http://www.postgresql.org/docs/8.1/interactive/install-upgrading.html">upgrade</a> and use PostgresSQL 8.1 under <a href="http://www.debian.org/News/2007/20070408">Debian 4.0</a> after all.</p>
<p>Before installing the 8.1 packages, I backed up by dumping the databases as well as saving copies of the files <em>server.key</em>, <em>server.crt</em>, and <em>root.crt</em>.</p>
<pre># su postgres
postgres# pg_dumpall &gt; outputfile
postgres# exit</pre>
<p>This time I referred to the correct package names for the PostgeSQL 8.1 server and client respectively.</p>
<pre># aptitude --show-versions --prompt install postgresql-8.1 postgresql-client-8.1
The following NEW packages will be installed:
  libpq4 [8.1.9-0etch1] postgresql-8.1 [8.1.9-0etch1]
  postgresql-client-8.1 [8.1.9-0etch1]
# aptitude update
# aptitude upgrade</pre>
<p>The configuration in <em>/etc/postgresql/8.1/main/postgresql.conf</em> has SSL enabled by default (<em>ssl = true</em>, <em>ssl_socket = true</em> is now obsolete), and I only had to adapt <em>pg_hba.conf</em> by commenting out three lines (they may actually have been commented already) and adding one  with the current IPv4 NAT address of my computer at home (actual address masked by placeholder CLIENT).</p>
<pre>local   all   postgres              ident sameuser
# local all   all                   ident sameuser
# host  all   all      127.0.0.1/32 md5
# host  all   all      ::1/128      md5
hostssl guava guava    CLIENT/32    md5</pre>
<p>Next, I copied the saved versions of <em>server.key</em>, <em>server.crt</em>, and <em>root.crt</em> into <em>/var/lib/var/lib/postgresql/8.1/main/</em> (after renaming three existing symbolic links by the same names into <em>*.save</em>), and set their owner and group to <em>postgres</em>. At this point, both versions are installed in parallel, and I can start either server, however the new one listens on port <a href="http://www.debian-administration.org/polls/100#comment_5">5433</a> for the time being.</p>
<pre># /etc/init.d/postgresql-7.4 stop
# /etc/init.d/postgresql-8.1 start
# su postgres
postgres# psql --port 5433
postgres=# \\q</pre>
<p>I tried the new client for restoring the data, and encountered a few error messages. From inspection of the SQL file I judged to ignore those.</p>
<pre>postgres# /usr/lib/postgresql/8.1/bin/psql -p 5433 -d postgres -f outfile
psql:/home/guava/outfile:11: ERROR:  cannot delete from a view
HINT:  You need an unconditional ON DELETE DO INSTEAD rule.
psql:/home/guava/outfile:13: NOTICE:  SYSID can no longer be specified
psql:/home/guava/outfile:20: ERROR:  cannot delete from a view
HINT:  You need an unconditional ON DELETE DO INSTEAD rule.
psql:/home/guava/outfile:122: NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create \\
implicit index "blog_pkey" for table "blog"
psql:/home/guava/outfile:131: NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create \\
implicit index "tag_pkey" for table "tag"</pre>
<p>I stopped the 8.1 server and switched it to the default port by setting <em>port = 5432</em> in <em>postgresql.conf</em>, and then removed the PostgreSQL 7.4 and its redundant dependent packages.</p>
<pre># aptitude -purge postgresql-7.4 postgresql-client-7.4
The following packages will be REMOVED:
  postgresql-7.4{p} postgresql-client-7.4{p}
The following packages have unmet dependencies:
  postgresql: Depends: postgresql-7.4 but it is not installable
  postgresql-client: Depends: postgresql-client-7.4 but it is not installable
The following actions will resolve these dependencies:
Remove the following packages:
postgresql
postgresql-client</pre>
<p>The 7.4 installation and its configuration files are now gone (<em>find / -name 7.4</em>), and I can restart the 8.1 server again. The JDBC client on my computer at home does not yet work, presumably because it does not do SSL client authentication against <em>root.crt</em> (was not supported in PostgreSQL 7.4). Local SSL loopback connectivity with <em>psql -h localhost</em> also does not work yet, presumably for related reasons. I&#8217;ll try to finish the SSL-related security update next, but at this time can already use the interactive terminal on a local Unix-domain socket connection.</p>
<pre># /etc/init.d/postgresql-8.1restart
# su postgres
postgres# psql
postgres=# \\q</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=16&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/08/03/upgrade-from-postgresql-74-to-81/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>
	</item>
		<item>
		<title>Signing the new deal</title>
		<link>http://quasiroot.wordpress.com/2007/07/31/signing-the-new-deal/</link>
		<comments>http://quasiroot.wordpress.com/2007/07/31/signing-the-new-deal/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 07:05:43 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[vps]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/07/31/signing-the-new-deal/</guid>
		<description><![CDATA[My experience with the new VPS provider during the one-week free trial period was a pleasant one, and I&#8217;ve now signed up for their monthly plan (see invoice below). There was only one incident (hardware hickup), which was quickly resolved on a Sunday. I could now get a dedicated domain name separately, but the prevalence [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=27&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My experience with the new VPS <a href="https://www.budgetdedicated.com">provider</a> during the one-week free trial period was a pleasant one, and I&#8217;ve now signed up for their monthly <a href="https://www.budgetdedicated.com/virtualdedicatedpricecalculator.php">plan</a> (see invoice below).  There was only one incident (hardware hickup), which was quickly resolved on a Sunday. I could now get a dedicated domain name separately, but the prevalence of search engine use has made this step somewhat <a href="http://www.poritz.net/jonathan/papers/searchers.pdf">irrelevant</a> and therefore optional.</p>
<p><img src="http://quasiroot.files.wordpress.com/2007/07/invoice2.jpg?w=480" alt="invoice2.jpg" /></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=27&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/07/31/signing-the-new-deal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>

		<media:content url="http://quasiroot.files.wordpress.com/2007/07/invoice2.jpg" medium="image">
			<media:title type="html">invoice2.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Certificate zoo</title>
		<link>http://quasiroot.wordpress.com/2007/07/26/certificate-zoo/</link>
		<comments>http://quasiroot.wordpress.com/2007/07/26/certificate-zoo/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 21:43:20 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/07/26/certificate-zoo/</guid>
		<description><![CDATA[So far I am only maintaining two applications with SSL authentication on the Debian server (ssh and PostgreSQL), but keeping track of all distinct certificates and private keys is already becoming quite difficult. I therefore plan on adopting a common simplifying convention under the following guiding principles. store only one local copy of certificates and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=17&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So far I am only maintaining two applications with SSL authentication on the Debian server (<em>ssh</em> and PostgreSQL<em>)</em>, but keeping track of all distinct certificates and private keys is already becoming quite difficult. I therefore plan on adopting a common simplifying convention under the following guiding principles.</p>
<ul>
<li>store only one local copy of certificates and keys on the host that generated each pair; preferably use directory <em>/etc/ssl/cert</em> for certificates, and <em>/etc/cert/private</em> for keys; create additional references as symbolic links</li>
<li>use only one self-signed certificate from a local certificate authority; sign all other new certificates with its key; don&#8217;t generate the root certificate and key on the server, but on my machine at home (Mac OS X)</li>
</ul>
<p>The drawing depicts a draft plan with the following notation (assumes PostgreSQL 8.1 with two types of client: JDBC on Mac OS X and <em>psql</em> on Debian).</p>
<ul>
<li>new certificates and keys on Debian server inside darker gray boxes</li>
<li>other unmodified certificate and keys on Debian server inside lighter gray boxes</li>
<li>new certificates and keys on Mac OS X client inside red boxes</li>
<li>master copy of certificates and keys (only one pair per host) in bold font</li>
<li>symbolic links in italic font</li>
<li>(*) in cases where another certificate and key is replaced (archived as <em>*.save</em> file)</li>
<li>connecting lines indicate two certificates signed with root key</li>
<li>application needs dictate certificate and key file names in directories other than <em>/etc/ssl/cert</em> and <em>/etc/cert/private</em></li>
</ul>
<p><img src="http://quasiroot.files.wordpress.com/2007/07/certificate_zoo8.png?w=480" alt="certificate_zoo8.png" /></p>
<p><strong>Update:</strong> locally created certificates should go into directory <em>/etc/ssl/certs</em> instead of <em>/etc/ssl/cert</em> (<a href="http://rourkevisualart.com/wordpress/about-atsh/">corrected</a> typo).<a href="http://quasiroot.files.wordpress.com/2007/07/certificate_zoo4.png" title="certificate_zoo4.png"><br />
</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=17&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/07/26/certificate-zoo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>

		<media:content url="http://quasiroot.files.wordpress.com/2007/07/certificate_zoo8.png" medium="image">
			<media:title type="html">certificate_zoo8.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Debian security updates</title>
		<link>http://quasiroot.wordpress.com/2007/07/24/debian-security-updates/</link>
		<comments>http://quasiroot.wordpress.com/2007/07/24/debian-security-updates/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 07:01:47 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/07/24/debian-security-updates/</guid>
		<description><![CDATA[The default /etc/apt/sources.list file did not yet account for security updates (RSS feed here). I added a new first line and ran aptitude update; aptitude upgrade. (I noticed that by now aptitude is the preferred program for Debian package management from console.) deb http://security.debian.org/ etch/updates main contrib non-free deb http://ftp.nl.debian.org/debian etch main As it turns [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=14&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The default <em>/etc/apt/sources.list</em> file did not yet account for <a href="http://www.debian.org/security/">security updates</a> (RSS feed <a href="http://www.debian.org/security/dsa-long">here</a>). I added a new first line and ran <code>aptitude update; aptitude upgrade</code>. (I noticed that by now <a href="http://www.debian.org/releases/stable/i386/release-notes/ch-whats-new.en.html">aptitude</a> is the preferred program for Debian package management from console.)</p>
<pre>deb http://security.debian.org/ etch/updates main contrib non-free
deb http://ftp.nl.debian.org/debian etch main</pre>
<p>As it turns out, my <a href="http://www.debian.org/security/2007/dsa-1311">PostgreSQL</a> installation was in need of security updates.</p>
<pre>The following packages will be upgraded:
  libkrb53 postgresql-7.4 postgresql-client-7.4</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=14&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/07/24/debian-security-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>
	</item>
		<item>
		<title>One more thing</title>
		<link>http://quasiroot.wordpress.com/2007/07/22/one-more-thing/</link>
		<comments>http://quasiroot.wordpress.com/2007/07/22/one-more-thing/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 19:58:22 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[postgres]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/07/22/one-more-thing/</guid>
		<description><![CDATA[Probably it is the case that PostgreSQL 7.4 does not support SSL client authentication. In my previous post, I was unintentionally linking to the most recent 8.2 manual, and the relevant section is indeed missing from the 7.4 manual. The older PostgreSQL version (in conjunction with the JDBC 3 driver) however does support SSL server [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=13&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Probably it is the case that PostgreSQL 7.4 <a href="http://archives.postgresql.org/pgsql-hackers/2005-08/msg01043.php">does not support</a> SSL client authentication. In my previous post, I was unintentionally linking to the most recent <a href="http://www.postgresql.org/docs/8.2/static/ssl-tcp.html">8.2</a> manual, and the relevant section is indeed missing from the <a href="http://www.postgresql.org/docs/7.4/static/jdbc.html">7.4</a> manual.</p>
<p>The older PostgreSQL version (in conjunction with the JDBC 3 driver) however does support SSL server authentication, as I just double-checked by temporarily removing the  server certificate from the client&#8217;s Java keystore.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=13&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/07/22/one-more-thing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>
	</item>
		<item>
		<title>PostgreSQL connectivity with JDBC over SSL</title>
		<link>http://quasiroot.wordpress.com/2007/07/22/postgresql-connectivity-with-jdbc-over-ssl/</link>
		<comments>http://quasiroot.wordpress.com/2007/07/22/postgresql-connectivity-with-jdbc-over-ssl/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 19:10:45 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/07/22/postgresql-connectivity-with-jdbc-over-ssl/</guid>
		<description><![CDATA[First, I configured the PostgreSQL server for SSL by changing two parameters in the file /var/lib/postgresql/7.4/main/postgresql.conf. tcpip_socket = true ssl = true I generated a private key and self-signed certificate for the PostgreSQL server. ANY is a placeholder for a pass phrase (it won&#8217;t be needed any further, because automatic database server start-up requires that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=12&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>First, I configured the PostgreSQL <a href="http://jdbc.postgresql.org/documentation/80/ssl.html#ssl-server">server</a> for SSL by changing two <a href="http://www.postgresql.org/docs/7.4/static/runtime-config.html">parameters</a> in the file <em>/var/lib/postgresql/7.4/main/postgresql.conf</em>.</p>
<pre>tcpip_socket = true
ssl = true</pre>
<p>I <a href="http://www.postgresql.org/docs/current/static/ssl-tcp.html">generated</a> a private key and self-signed certificate for the PostgreSQL server. <em>ANY</em> is a placeholder for a pass phrase (it won&#8217;t be needed any further, because automatic database server start-up requires that we store an unencrypted private key); <em>HOST</em> is a placeholder for my VPS host name.</p>
<pre># openssl req -new -text -out pg_server.req
Enter PEM pass phrase: ANY
Common Name (eg, YOUR name) []: HOST.vps.budgetdedicated.com
# openssl rsa -in privkey.pem -out pg_server.key
# openssl req -x509 -in pg_server.req -text -key pg_server.key -out pg_server.crt
# chmod og-rwx pg_server.key
# rm privkey.pem pg_server.req</pre>
<p>Next, I switched to my client machine (an <a href="http://www.apple.com/de/imac/">iMac G5</a>, which runs Mac OS X, OpenSSL 0.9.7l, <a href="http://java.sun.com/j2se/1.5.0/">Java 1.5</a>, and <a href="http://www.eclipse.org/">Eclipse 3.3</a> among other things) and generated a private key and self-signed certificate for its use (and for client certificate verification on the server).</p>
<pre>$ openssl req -new -text -out pg_client.req
Enter PEM pass phrase: ANY
Common Name (eg, YOUR name) []: mymac
$ openssl rsa -in privkey.pem -out pg_client.key
$ openssl req -x509 -in pg_client.req -text -key pg_client.key -out pg_client.crt
$ chmod og-rwx pg_client.key
$ rm privkey.pem pg_client.req</pre>
<p>I used <em>scp</em> for copying the certificate files <em>pg_server.crt</em> and <em>pg_client.crt</em> to both machines. I then installed the various cryptographic instruments in the PostgreSQL data directory and restarted the server.</p>
<pre># su postgres
# mv /var/lib/postgresql/7.4/main/root.crt root.crt.save
# cp pg_server.key /var/lib/postgresql/7.4/main/server.key
# cp pg_server.crt /var/lib/postgresql/7.4/main/server.crt
# cp pg_client.crt /var/lib/postgresql/7.4/main/root.crt
# /etc/init.d/postgresql-7.4 restart</pre>
<p>On the <a href="http://jdbc.postgresql.org/documentation/80/ssl-client.html">client</a>, the equivalent step consists of adding the server certificate to the Java key store (<a href="http://www.google.ch/search?q=java+keystore+%22default+password%22">default password</a> applies).</p>
<pre>$ sudo su -
# export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
# openssl x509 -in pg_server.crt -out pg_server.crt.der -outform der
# keytool -keystore $JAVA_HOME/lib/security/cacerts -alias pg_server \\
          -import -file pg_server.crt.der</pre>
<p>I wrote a Java <a href="http://www.junit.org">test case</a> in <a href="http://www.eclipse.org">Eclipse</a>, and then installed and added the PostgreSQL <a href="http://jdbc.postgresql.org/download/postgresql-8.3dev-600.jdbc3.jar">JDBC 3</a> driver to the project build path. As before, <em>HOST</em> and <em>PASSWORD</em> are placeholders for my VPS host name and guava&#8217;s PostgreSQL password respectively.</p>
<pre>package guava.junit;

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Properties;
import org.junit.Test;
import static org.junit.Assert.*;

public class JdbcRemotePostgreSqlTest {

  @Test public void connection() throws Exception {
    Class.forName("org.postgresql.Driver").newInstance();

    final String     url        = "jdbc:postgresql://HOST.vps.budgetdedicated.com/guava";
    final Properties properties = new Properties();
    properties.put("user",     "guava");
    properties.put("password", "PASSWORD");
    properties.put("ssl",      "true");

    Connection connection = DriverManager.getConnection(url, properties);
    assertFalse(connection.isClosed());

    connection.close();
  }
}</pre>
<p>The test case succeeded, and the following remote authentication steps are in effect:</p>
<ul>
<li>JDBC client validates PostgreSQL server certificate</li>
<li>PostgreSQL server checks IP address of (JDBC) client</li>
<li>PostgreSQL server requires password from (JDBC) client (digest over SSL)</li>
</ul>
<p>As for client certificate validation by the PostgeSQL server, I&#8217;m still a bit puzzled. Since there is a <em>root.crt</em> (with a copy of <em>pg_client.crt</em>) on the server, I would expect that the server enforces this check, but so far the Java program does not yet know nor convey the right client credential. Further inspection of <a href="http://jdbc.postgresql.org/documentation/80/ssl-client.html">debugging</a> information suggests that the server sends a <a href="http://www.ietf.org/rfc/rfc2246.txt">Certificate request</a> (as it should), and the client replies with zero <a href="http://www.ietf.org/rfc/rfc2246.txt">Client certificates</a> (as it also should, but why does the server let this pass?). Anyway, I&#8217;ll call it a day for now, and the setup is probably already quite secure as is :)</p>
<p>I&#8217;ve also deleted all of the aforementioned files <em>pg_*</em> on both machines (those copies are no longer needed).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=12&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/07/22/postgresql-connectivity-with-jdbc-over-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting the local timezone</title>
		<link>http://quasiroot.wordpress.com/2007/07/22/setting-the-local-timezone/</link>
		<comments>http://quasiroot.wordpress.com/2007/07/22/setting-the-local-timezone/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 11:18:05 +0000</pubDate>
		<dc:creator>quasiroot</dc:creator>
				<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://quasiroot.wordpress.com/2007/07/22/setting-the-local-timezone/</guid>
		<description><![CDATA[The system was still on UTC, and I used tzconfig to set the timezone to CET.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=11&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The system was still on UTC, and I used <a href="http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html#s-tzconfig">tzconfig</a> to set the timezone to CET.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quasiroot.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quasiroot.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quasiroot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quasiroot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quasiroot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quasiroot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/quasiroot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/quasiroot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/quasiroot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/quasiroot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quasiroot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quasiroot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quasiroot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quasiroot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quasiroot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quasiroot.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quasiroot.wordpress.com&amp;blog=1384069&amp;post=11&amp;subd=quasiroot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://quasiroot.wordpress.com/2007/07/22/setting-the-local-timezone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee113d356cc590b00554f2a84e011b90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quasiroot</media:title>
		</media:content>
	</item>
	</channel>
</rss>
