Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5957A6326F5 for ; Fri, 16 Apr 2010 18:08:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 47989-04 for ; Fri, 16 Apr 2010 21:08:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id 8A361632898 for ; Fri, 16 Apr 2010 18:08:18 -0300 (ADT) Received: by mail-wy0-f174.google.com with SMTP id 39so1436971wyb.19 for ; Fri, 16 Apr 2010 14:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:received:message-id:subject :from:to:content-type:content-transfer-encoding; bh=bfaj4yAv66JyIy5SIv7itus1FzqqHUcUQ0OYjFoC2o4=; b=ufiFKeG5VdPBxKwlA8EtWCD3JSvUIJjBYHYB0EG2sWTL4lifhPU7PPwOT5lBPY2kH5 1zGzTGhivIpXRAEnVX6upnYysB1jc12qp2ImObnxK7oaUzgVq4mWTSWk65tE95o6ETF5 PoxGTU9z29QttqU2o7U7pVPuPWnI2FuWDuF+o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=SG03nZ7lnsrWSLDHrGuLLFv6nnOZmFmWIwPav1SL3YHFpYNDOwVhkDCDKGNcpF+357 R8Pe6g8CbcR2mVp516LEP5/Ej2niWP5J7IQHpyeEvR6r0QEN/h8LF66uD9cAq+HWXPXk 9jBl0Yg7MlNtSyjx7yNSKNf6q+VUP5j2V56sg= MIME-Version: 1.0 Received: by 10.216.168.135 with HTTP; Fri, 16 Apr 2010 14:08:17 -0700 (PDT) In-Reply-To: <20100416073417.132000@gmx.net> References: <201004150206.o3F26U427784@momjian.us> <20100415074542.137300@gmx.net> <20100416073417.132000@gmx.net> Date: Fri, 16 Apr 2010 18:08:17 -0300 X-Google-Sender-Auth: 6e6505ec23fec7e4 Received: by 10.216.91.9 with SMTP id g9mr2629832wef.194.1271452097555; Fri, 16 Apr 2010 14:08:17 -0700 (PDT) Message-ID: Subject: Re: PostgreSQL with SSL From: Jose Berardo To: =?ISO-8859-1?Q?Martin_M=FCnstermann?= , pgsql-admin@postgresql.org, Bruce Momjian , Tom Lane Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.811 tagged_above=-10 required=5 tests=BAYES_50=0.8, FREEMAIL_FROM=0.001, T_FRT_BELOW2=0.01 X-Spam-Level: X-Archive-Number: 201004/279 X-Sequence-Number: 34373 Hello, On Fri, Apr 16, 2010 at 4:34 AM, "Martin M=FCnstermann" wr= ote: > Hello. > >> > > I'm trying to use the java keytool in place of openssl. >> > > - I believe that it not possible to start the PostgreSQL server >> without >> > > openssl (and ssl-dev package in debian), is it correct? >> > >> > Yes, I don't think the java keytool works. >> >> Oh, the documentation defeated me twice. The server reads the openssl >> configuration at start time too. >> The keytool may be used only to generate the key pair and the certificat= e, >> but it can not export the private key from its keystore. You need anothe= r >> tool or to write a Java code to do that. > > OpenSSL has two ways to store private keys: > 1. an own proprietary format > 2. standard PKCS#8 > > The default as used in the postgresql doc is to produce the proprietary f= ormat. > Don't know if PostgreSQL can handle PKCS#8 keys. > > If you'd like to check, here is a command to produce PKCS#8: > openssl pkcs8 -in server.key =A0-out server.p8 -topk8 I've test your suggestion, but it didn't work. Results bellow: $ Enter PEM pass phrase: FATAL: could not load private key file "server.key": problems getting pass= word As Tom Laine has explained, the service don't work with encrypted keys because it would need to ask the administrator for the password (like above), and would not start until he gives it. The server would need to keep the clear key in memory for every connection. Anyway, would still be possible one attacker obtain the key. > > Jose, writing a tutorial sounds promising. If I can be of any help, just = contact me. Thanks Martin, I'm writing in portuguese, but I will ask a friend for help me in translation to english. When it's done, I will send to you. Any consideration will be extreme welco= me. > > Martin > > -- > GRATIS f=FCr alle GMX-Mitglieder: Die maxdome Movie-FLAT! > Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 > --=20 Regards, Jose Berardo Especializa Treinamentos www.especializa.com.br +55 81 3465.0032