X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1C32B9FB304 for ; Wed, 20 Sep 2006 23:51:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 93284-10 for ; Wed, 20 Sep 2006 23:51:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id A6E379FB2F6 for ; Wed, 20 Sep 2006 23:51:23 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id k8L2pF2P073737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Sep 2006 20:51:17 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id k8L2pEbL074082; Wed, 20 Sep 2006 20:51:14 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id k8L2pCvU074081; Wed, 20 Sep 2006 20:51:12 -0600 (MDT) (envelope-from mfuhr) Date: Wed, 20 Sep 2006 20:51:12 -0600 From: Michael Fuhr To: Jeanna Geier Cc: pgsql-admin@postgresql.org Subject: Re: Beginning SSL Questions Message-ID: <20060921025112.GA73386@winnie.fuhr.org> References: <009801c6d808$7200a260$6700a8c0@geier> <20060914150157.GA76098@winnie.fuhr.org> <007a01c6dcf4$057dcfa0$6700a8c0@geier> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <007a01c6dcf4$057dcfa0$6700a8c0@geier> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.15 tagged_above=0 required=5 tests=AWL, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/224 X-Sequence-Number: 23138 On Wed, Sep 20, 2006 at 03:33:18PM -0500, Jeanna Geier wrote: > Hopefully someone here has some OpenSSL expertise and can help me with a > problem I'm running into... [...] > So, I changed to the openssl-0.9.8c directory to build my keyfile and > certificate and am having no luck and could really use someone's > expertise!! When I enter the command line option to generate the keyfile, > it says it's generating the file, but it just hangs there.... I've left it > running, but it doesn't complete, it only outputs the two lines with > '.......++++++' and stops: > > $ openssl genrsa -des3 -out server.key 2048 > Loading 'screen' into random state - done > Generating RSA private key, 2048 bit long modulus > ........................................+++ > ......+++ That command should work; here's what it does on my FreeBSD system: % openssl genrsa -des3 -out server.key 2048 Generating RSA private key, 2048 bit long modulus ...............+++ ............................+++ e is 65537 (0x10001) Enter pass phrase for server.key: Verifying - Enter pass phrase for server.key: Your prime number generation appears to have completed but the command hangs before displaying the encryption exponent. How long did you wait? The OpenSSL source code has only a few lines between those two actions, one of which is: app_RAND_write_file(NULL, bio_err); I wonder if that's where the command is hanging. That function generates cryptographically strong pseudo-random bytes and saves them to a file for future use, so it's possible that you didn't wait long enough. If your system doesn't have enough entropy then it might be waiting to gather more, in which case wiggling the mouse or banging on the keyboard might help (assuming your system gathers entropy from "random" activity like interrupts). If not then you could try commenting out that line (line 264) in apps/genrsa.c, then rebuild and reinstall OpenSSL. That's not a good solution but if key generation completes after making that change then at least you'd have pinpointed the problem. Incidentally, if you encrypt the private key (as you're doing with the -des3 option) then the postmaster will prompt for the password every time it starts. That'll prevent the postmaster from starting unattended. -- Michael Fuhr