pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedSSL patch
13+ messages / 5 participants
[nested] [flat]
* SSL patch
@ 2011-09-13 18:41 Bodor Andras <bodri.mh3@gmail.com>
0 siblings, 1 reply; 13+ messages in thread
From: Bodor Andras @ 2011-09-13 18:41 UTC (permalink / raw)
To: pgsql-jdbc
Hi!
Can You make any use of my SSL patch sent in on the 23th of August?
Andras
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-09-15 11:47 Dave Cramer <pg@fastcrypt.com>
parent: Bodor Andras <bodri.mh3@gmail.com>
0 siblings, 1 reply; 13+ messages in thread
From: Dave Cramer @ 2011-09-15 11:47 UTC (permalink / raw)
To: Bodor Andras <bodri.mh3@gmail.com>; +Cc: pgsql-jdbc
Hi Bodor,
So do you have any test cases for this ?
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
2011/9/13 Bodor Andras <bodri.mh3@gmail.com>:
>
> Hi!
>
> Can You make any use of my SSL patch sent in on the 23th of August?
> Andras
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-09-15 15:41 Bodor Andras <bodri.mh3@gmail.com>
parent: Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 13+ messages in thread
From: Bodor Andras @ 2011-09-15 15:41 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc
Yes, it is also included in the patch
(package org.postgresql.test.ssl). It
tries to connect to a series of databases
with different ssl properties. The connection
strings are given in the ssltest.properties
file in the root of the distribution. Just
comment out the connstrings, that you don't
want to run. Also read the certdir/README
file. (build.xml is modified to run this test.)
Andras
Dave Cramer wrote:
> Hi Bodor,
>
> So do you have any test cases for this ?
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
>
>
>
> 2011/9/13 Bodor Andras<bodri.mh3@gmail.com>:
>>
>> Hi!
>>
>> Can You make any use of my SSL patch sent in on the 23th of August?
>> Andras
>>
>> --
>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>
>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-10 13:56 Dave Cramer <pg@fastcrypt.com>
parent: Bodor Andras <bodri.mh3@gmail.com>
0 siblings, 2 replies; 13+ messages in thread
From: Dave Cramer @ 2011-11-10 13:56 UTC (permalink / raw)
To: Bodor Andras <bodri.mh3@gmail.com>; +Cc: pgsql-jdbc
Andras,
I'm looking at your patch attached to this link
http://archives.postgresql.org/pgsql-jdbc/2011-08/msg00067.php right
now. Thanks by the way!
The only thing I'd like to pose to the list is the necessity for
sslinfo to be installed in any database. I can envision some
production environments which this may not be possible ?
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Thu, Sep 15, 2011 at 11:41 AM, Bodor Andras <bodri.mh3@gmail.com> wrote:
>
> Yes, it is also included in the patch
> (package org.postgresql.test.ssl). It
> tries to connect to a series of databases
> with different ssl properties. The connection
> strings are given in the ssltest.properties
> file in the root of the distribution. Just
> comment out the connstrings, that you don't
> want to run. Also read the certdir/README
> file. (build.xml is modified to run this test.)
> Andras
>
>
> Dave Cramer wrote:
>>
>> Hi Bodor,
>>
>> So do you have any test cases for this ?
>>
>> Dave Cramer
>>
>> dave.cramer(at)credativ(dot)ca
>> http://www.credativ.ca
>>
>>
>>
>>
>> 2011/9/13 Bodor Andras<bodri.mh3@gmail.com>:
>>>
>>> Hi!
>>>
>>> Can You make any use of my SSL patch sent in on the 23th of August?
>>> Andras
>>>
>>> --
>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>
>>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-10 14:30 Bodor András <bodri.mh3@gmail.com>
parent: Dave Cramer <pg@fastcrypt.com>
1 sibling, 2 replies; 13+ messages in thread
From: Bodor András @ 2011-11-10 14:30 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc
Dear Dave,
The installation of sslinfo is only necessary for the unit tests, it is
not used at all in the driver itself. Obviously I wanted to test weather
we were actually using ssl, but it is not essential. It can be removed,
or an additional option can be introduced to ssltest.properties.
The relevant lines are in
org.postgresql.test.ssl.SslTest.driver(String connstr, Object[]
expected)
There are a few things still to be done with this patch.
1. the jdbc datasource interface was not modified at all,
so it is unaware of the new options,
2. it should be decided, what is the expected behaviour of sslmode=allow
or prefer (they might be omitted completely),
3. I have not tested certificate chains yet,
4. when a client certificate is available, the v8 and v9 servers
behave differently (BUG #5468 is fixed in v9) so different unit test are
needed to check this,
5. there is a list of options somewhere in the code, this should
be updated as well,
6. documentation.
Andras
On Thu, Nov 10, 2011 at 2:56 PM, Dave Cramer <pg@fastcrypt.com> wrote:
> Andras,
>
> I'm looking at your patch attached to this link
> http://archives.postgresql.org/pgsql-jdbc/2011-08/msg00067.php right
> now. Thanks by the way!
>
> The only thing I'd like to pose to the list is the necessity for
> sslinfo to be installed in any database. I can envision some
> production environments which this may not be possible ?
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
>
>
>
> On Thu, Sep 15, 2011 at 11:41 AM, Bodor Andras <bodri.mh3@gmail.com> wrote:
>>
>> Yes, it is also included in the patch
>> (package org.postgresql.test.ssl). It
>> tries to connect to a series of databases
>> with different ssl properties. The connection
>> strings are given in the ssltest.properties
>> file in the root of the distribution. Just
>> comment out the connstrings, that you don't
>> want to run. Also read the certdir/README
>> file. (build.xml is modified to run this test.)
>> Andras
>>
>>
>> Dave Cramer wrote:
>>>
>>> Hi Bodor,
>>>
>>> So do you have any test cases for this ?
>>>
>>> Dave Cramer
>>>
>>> dave.cramer(at)credativ(dot)ca
>>> http://www.credativ.ca
>>>
>>>
>>>
>>>
>>> 2011/9/13 Bodor Andras<bodri.mh3@gmail.com>:
>>>>
>>>> Hi!
>>>>
>>>> Can You make any use of my SSL patch sent in on the 23th of August?
>>>> Andras
>>>>
>>>> --
>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>
>>>
>>
>>
>> --
>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>
>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-10 14:46 Magosányi Árpád <mag@magwas.rulez.org>
parent: Dave Cramer <pg@fastcrypt.com>
1 sibling, 0 replies; 13+ messages in thread
From: Magosányi Árpád @ 2011-11-10 14:46 UTC (permalink / raw)
To: pgsql-jdbc
Isn't sslinfo used only for testing the functionality?
BTW I haven't yet take the time to figure out whether smartcards through
pkcs11 interface can be used either with this, or the custom
certauthfactory solution.
It works with psql using sslkey=pkcs11:<certificate id>, and it would be
nice to have the same functionality with a similar config in jdbc as well.
On 2011-11-10 14:56, Dave Cramer wrote:
> Andras,
>
> I'm looking at your patch attached to this link
> http://archives.postgresql.org/pgsql-jdbc/2011-08/msg00067.php right
> now. Thanks by the way!
>
> The only thing I'd like to pose to the list is the necessity for
> sslinfo to be installed in any database. I can envision some
> production environments which this may not be possible ?
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
>
>
>
> On Thu, Sep 15, 2011 at 11:41 AM, Bodor Andras<bodri.mh3@gmail.com> wrote:
>> Yes, it is also included in the patch
>> (package org.postgresql.test.ssl). It
>> tries to connect to a series of databases
>> with different ssl properties. The connection
>> strings are given in the ssltest.properties
>> file in the root of the distribution. Just
>> comment out the connstrings, that you don't
>> want to run. Also read the certdir/README
>> file. (build.xml is modified to run this test.)
>> Andras
>>
>>
>> Dave Cramer wrote:
>>> Hi Bodor,
>>>
>>> So do you have any test cases for this ?
>>>
>>> Dave Cramer
>>>
>>> dave.cramer(at)credativ(dot)ca
>>> http://www.credativ.ca
>>>
>>>
>>>
>>>
>>> 2011/9/13 Bodor Andras<bodri.mh3@gmail.com>:
>>>> Hi!
>>>>
>>>> Can You make any use of my SSL patch sent in on the 23th of August?
>>>> Andras
>>>>
>>>> --
>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>
>>
>> --
>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-10 15:19 Dave Cramer <pg@fastcrypt.com>
parent: Bodor András <bodri.mh3@gmail.com>
1 sibling, 1 reply; 13+ messages in thread
From: Dave Cramer @ 2011-11-10 15:19 UTC (permalink / raw)
To: Bodor András <bodri.mh3@gmail.com>; +Cc: pgsql-jdbc
Hi Bodor,
Understood.
So now all the tests are failing some due to unknown ca, others to
certificate expired ?
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Thu, Nov 10, 2011 at 9:30 AM, Bodor András <bodri.mh3@gmail.com> wrote:
> Dear Dave,
>
> The installation of sslinfo is only necessary for the unit tests, it is
> not used at all in the driver itself. Obviously I wanted to test weather
> we were actually using ssl, but it is not essential. It can be removed,
> or an additional option can be introduced to ssltest.properties.
> The relevant lines are in
> org.postgresql.test.ssl.SslTest.driver(String connstr, Object[]
> expected)
>
> There are a few things still to be done with this patch.
> 1. the jdbc datasource interface was not modified at all,
> so it is unaware of the new options,
> 2. it should be decided, what is the expected behaviour of sslmode=allow
> or prefer (they might be omitted completely),
> 3. I have not tested certificate chains yet,
> 4. when a client certificate is available, the v8 and v9 servers
> behave differently (BUG #5468 is fixed in v9) so different unit test are
> needed to check this,
> 5. there is a list of options somewhere in the code, this should
> be updated as well,
> 6. documentation.
>
> Andras
>
> On Thu, Nov 10, 2011 at 2:56 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>> Andras,
>>
>> I'm looking at your patch attached to this link
>> http://archives.postgresql.org/pgsql-jdbc/2011-08/msg00067.php right
>> now. Thanks by the way!
>>
>> The only thing I'd like to pose to the list is the necessity for
>> sslinfo to be installed in any database. I can envision some
>> production environments which this may not be possible ?
>>
>> Dave Cramer
>>
>> dave.cramer(at)credativ(dot)ca
>> http://www.credativ.ca
>>
>>
>>
>>
>> On Thu, Sep 15, 2011 at 11:41 AM, Bodor Andras <bodri.mh3@gmail.com> wrote:
>>>
>>> Yes, it is also included in the patch
>>> (package org.postgresql.test.ssl). It
>>> tries to connect to a series of databases
>>> with different ssl properties. The connection
>>> strings are given in the ssltest.properties
>>> file in the root of the distribution. Just
>>> comment out the connstrings, that you don't
>>> want to run. Also read the certdir/README
>>> file. (build.xml is modified to run this test.)
>>> Andras
>>>
>>>
>>> Dave Cramer wrote:
>>>>
>>>> Hi Bodor,
>>>>
>>>> So do you have any test cases for this ?
>>>>
>>>> Dave Cramer
>>>>
>>>> dave.cramer(at)credativ(dot)ca
>>>> http://www.credativ.ca
>>>>
>>>>
>>>>
>>>>
>>>> 2011/9/13 Bodor Andras<bodri.mh3@gmail.com>:
>>>>>
>>>>> Hi!
>>>>>
>>>>> Can You make any use of my SSL patch sent in on the 23th of August?
>>>>> Andras
>>>>>
>>>>> --
>>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>>> To make changes to your subscription:
>>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>>
>>>>
>>>
>>>
>>> --
>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>
>>
>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-10 15:45 Bodor András <bodri.mh3@gmail.com>
parent: Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 13+ messages in thread
From: Bodor András @ 2011-11-10 15:45 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc
Can you send me some error log, and your database setup?
On Thu, Nov 10, 2011 at 4:19 PM, Dave Cramer <pg@fastcrypt.com> wrote:
> Hi Bodor,
>
> Understood.
>
> So now all the tests are failing some due to unknown ca, others to
> certificate expired ?
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
>
>
>
> On Thu, Nov 10, 2011 at 9:30 AM, Bodor András <bodri.mh3@gmail.com> wrote:
>> Dear Dave,
>>
>> The installation of sslinfo is only necessary for the unit tests, it is
>> not used at all in the driver itself. Obviously I wanted to test weather
>> we were actually using ssl, but it is not essential. It can be removed,
>> or an additional option can be introduced to ssltest.properties.
>> The relevant lines are in
>> org.postgresql.test.ssl.SslTest.driver(String connstr, Object[]
>> expected)
>>
>> There are a few things still to be done with this patch.
>> 1. the jdbc datasource interface was not modified at all,
>> so it is unaware of the new options,
>> 2. it should be decided, what is the expected behaviour of sslmode=allow
>> or prefer (they might be omitted completely),
>> 3. I have not tested certificate chains yet,
>> 4. when a client certificate is available, the v8 and v9 servers
>> behave differently (BUG #5468 is fixed in v9) so different unit test are
>> needed to check this,
>> 5. there is a list of options somewhere in the code, this should
>> be updated as well,
>> 6. documentation.
>>
>> Andras
>>
>> On Thu, Nov 10, 2011 at 2:56 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>>> Andras,
>>>
>>> I'm looking at your patch attached to this link
>>> http://archives.postgresql.org/pgsql-jdbc/2011-08/msg00067.php right
>>> now. Thanks by the way!
>>>
>>> The only thing I'd like to pose to the list is the necessity for
>>> sslinfo to be installed in any database. I can envision some
>>> production environments which this may not be possible ?
>>>
>>> Dave Cramer
>>>
>>> dave.cramer(at)credativ(dot)ca
>>> http://www.credativ.ca
>>>
>>>
>>>
>>>
>>> On Thu, Sep 15, 2011 at 11:41 AM, Bodor Andras <bodri.mh3@gmail.com> wrote:
>>>>
>>>> Yes, it is also included in the patch
>>>> (package org.postgresql.test.ssl). It
>>>> tries to connect to a series of databases
>>>> with different ssl properties. The connection
>>>> strings are given in the ssltest.properties
>>>> file in the root of the distribution. Just
>>>> comment out the connstrings, that you don't
>>>> want to run. Also read the certdir/README
>>>> file. (build.xml is modified to run this test.)
>>>> Andras
>>>>
>>>>
>>>> Dave Cramer wrote:
>>>>>
>>>>> Hi Bodor,
>>>>>
>>>>> So do you have any test cases for this ?
>>>>>
>>>>> Dave Cramer
>>>>>
>>>>> dave.cramer(at)credativ(dot)ca
>>>>> http://www.credativ.ca
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2011/9/13 Bodor Andras<bodri.mh3@gmail.com>:
>>>>>>
>>>>>> Hi!
>>>>>>
>>>>>> Can You make any use of my SSL patch sent in on the 23th of August?
>>>>>> Andras
>>>>>>
>>>>>> --
>>>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>>>> To make changes to your subscription:
>>>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>
>>>
>>
>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-10 15:55 Dave Cramer <pg@fastcrypt.com>
parent: Bodor András <bodri.mh3@gmail.com>
0 siblings, 1 reply; 13+ messages in thread
From: Dave Cramer @ 2011-11-10 15:55 UTC (permalink / raw)
To: Bodor András <bodri.mh3@gmail.com>; +Cc: pgsql-jdbc
Andras,
I noticed that the server.crt in the patch is only good for 1 month
and expires in Sept of this year.
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Thu, Nov 10, 2011 at 10:45 AM, Bodor András <bodri.mh3@gmail.com> wrote:
> Can you send me some error log, and your database setup?
>
> On Thu, Nov 10, 2011 at 4:19 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>> Hi Bodor,
>>
>> Understood.
>>
>> So now all the tests are failing some due to unknown ca, others to
>> certificate expired ?
>>
>> Dave Cramer
>>
>> dave.cramer(at)credativ(dot)ca
>> http://www.credativ.ca
>>
>>
>>
>>
>> On Thu, Nov 10, 2011 at 9:30 AM, Bodor András <bodri.mh3@gmail.com> wrote:
>>> Dear Dave,
>>>
>>> The installation of sslinfo is only necessary for the unit tests, it is
>>> not used at all in the driver itself. Obviously I wanted to test weather
>>> we were actually using ssl, but it is not essential. It can be removed,
>>> or an additional option can be introduced to ssltest.properties.
>>> The relevant lines are in
>>> org.postgresql.test.ssl.SslTest.driver(String connstr, Object[]
>>> expected)
>>>
>>> There are a few things still to be done with this patch.
>>> 1. the jdbc datasource interface was not modified at all,
>>> so it is unaware of the new options,
>>> 2. it should be decided, what is the expected behaviour of sslmode=allow
>>> or prefer (they might be omitted completely),
>>> 3. I have not tested certificate chains yet,
>>> 4. when a client certificate is available, the v8 and v9 servers
>>> behave differently (BUG #5468 is fixed in v9) so different unit test are
>>> needed to check this,
>>> 5. there is a list of options somewhere in the code, this should
>>> be updated as well,
>>> 6. documentation.
>>>
>>> Andras
>>>
>>> On Thu, Nov 10, 2011 at 2:56 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>>>> Andras,
>>>>
>>>> I'm looking at your patch attached to this link
>>>> http://archives.postgresql.org/pgsql-jdbc/2011-08/msg00067.php right
>>>> now. Thanks by the way!
>>>>
>>>> The only thing I'd like to pose to the list is the necessity for
>>>> sslinfo to be installed in any database. I can envision some
>>>> production environments which this may not be possible ?
>>>>
>>>> Dave Cramer
>>>>
>>>> dave.cramer(at)credativ(dot)ca
>>>> http://www.credativ.ca
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Sep 15, 2011 at 11:41 AM, Bodor Andras <bodri.mh3@gmail.com> wrote:
>>>>>
>>>>> Yes, it is also included in the patch
>>>>> (package org.postgresql.test.ssl). It
>>>>> tries to connect to a series of databases
>>>>> with different ssl properties. The connection
>>>>> strings are given in the ssltest.properties
>>>>> file in the root of the distribution. Just
>>>>> comment out the connstrings, that you don't
>>>>> want to run. Also read the certdir/README
>>>>> file. (build.xml is modified to run this test.)
>>>>> Andras
>>>>>
>>>>>
>>>>> Dave Cramer wrote:
>>>>>>
>>>>>> Hi Bodor,
>>>>>>
>>>>>> So do you have any test cases for this ?
>>>>>>
>>>>>> Dave Cramer
>>>>>>
>>>>>> dave.cramer(at)credativ(dot)ca
>>>>>> http://www.credativ.ca
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2011/9/13 Bodor Andras<bodri.mh3@gmail.com>:
>>>>>>>
>>>>>>> Hi!
>>>>>>>
>>>>>>> Can You make any use of my SSL patch sent in on the 23th of August?
>>>>>>> Andras
>>>>>>>
>>>>>>> --
>>>>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>>>>> To make changes to your subscription:
>>>>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>>> To make changes to your subscription:
>>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>>
>>>>
>>>
>>
>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-10 16:13 Bodor András <bodri.mh3@gmail.com>
parent: Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 13+ messages in thread
From: Bodor András @ 2011-11-10 16:13 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc
For the time beeing, you may create new certificates by issuing
openssl req -x509 -newkey -nodes -days 36500 -nodes -keyout server.key
-out server.crt
they will be good for 100 years. Or shall I send a new patch?
For the question of Magosányi Árpád, rigth now pkcs11 is not supported,
but it is not a complicated thing. We can return to it, when this patch works.
Andras
On Thu, Nov 10, 2011 at 4:55 PM, Dave Cramer <pg@fastcrypt.com> wrote:
> Andras,
>
> I noticed that the server.crt in the patch is only good for 1 month
> and expires in Sept of this year.
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
>
>
>
> On Thu, Nov 10, 2011 at 10:45 AM, Bodor András <bodri.mh3@gmail.com> wrote:
>> Can you send me some error log, and your database setup?
>>
>> On Thu, Nov 10, 2011 at 4:19 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>>> Hi Bodor,
>>>
>>> Understood.
>>>
>>> So now all the tests are failing some due to unknown ca, others to
>>> certificate expired ?
>>>
>>> Dave Cramer
>>>
>>> dave.cramer(at)credativ(dot)ca
>>> http://www.credativ.ca
>>>
>>>
>>>
>>>
>>> On Thu, Nov 10, 2011 at 9:30 AM, Bodor András <bodri.mh3@gmail.com> wrote:
>>>> Dear Dave,
>>>>
>>>> The installation of sslinfo is only necessary for the unit tests, it is
>>>> not used at all in the driver itself. Obviously I wanted to test weather
>>>> we were actually using ssl, but it is not essential. It can be removed,
>>>> or an additional option can be introduced to ssltest.properties.
>>>> The relevant lines are in
>>>> org.postgresql.test.ssl.SslTest.driver(String connstr, Object[]
>>>> expected)
>>>>
>>>> There are a few things still to be done with this patch.
>>>> 1. the jdbc datasource interface was not modified at all,
>>>> so it is unaware of the new options,
>>>> 2. it should be decided, what is the expected behaviour of sslmode=allow
>>>> or prefer (they might be omitted completely),
>>>> 3. I have not tested certificate chains yet,
>>>> 4. when a client certificate is available, the v8 and v9 servers
>>>> behave differently (BUG #5468 is fixed in v9) so different unit test are
>>>> needed to check this,
>>>> 5. there is a list of options somewhere in the code, this should
>>>> be updated as well,
>>>> 6. documentation.
>>>>
>>>> Andras
>>>>
>>>> On Thu, Nov 10, 2011 at 2:56 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>>>>> Andras,
>>>>>
>>>>> I'm looking at your patch attached to this link
>>>>> http://archives.postgresql.org/pgsql-jdbc/2011-08/msg00067.php right
>>>>> now. Thanks by the way!
>>>>>
>>>>> The only thing I'd like to pose to the list is the necessity for
>>>>> sslinfo to be installed in any database. I can envision some
>>>>> production environments which this may not be possible ?
>>>>>
>>>>> Dave Cramer
>>>>>
>>>>> dave.cramer(at)credativ(dot)ca
>>>>> http://www.credativ.ca
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Sep 15, 2011 at 11:41 AM, Bodor Andras <bodri.mh3@gmail.com> wrote:
>>>>>>
>>>>>> Yes, it is also included in the patch
>>>>>> (package org.postgresql.test.ssl). It
>>>>>> tries to connect to a series of databases
>>>>>> with different ssl properties. The connection
>>>>>> strings are given in the ssltest.properties
>>>>>> file in the root of the distribution. Just
>>>>>> comment out the connstrings, that you don't
>>>>>> want to run. Also read the certdir/README
>>>>>> file. (build.xml is modified to run this test.)
>>>>>> Andras
>>>>>>
>>>>>>
>>>>>> Dave Cramer wrote:
>>>>>>>
>>>>>>> Hi Bodor,
>>>>>>>
>>>>>>> So do you have any test cases for this ?
>>>>>>>
>>>>>>> Dave Cramer
>>>>>>>
>>>>>>> dave.cramer(at)credativ(dot)ca
>>>>>>> http://www.credativ.ca
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 2011/9/13 Bodor Andras<bodri.mh3@gmail.com>:
>>>>>>>>
>>>>>>>> Hi!
>>>>>>>>
>>>>>>>> Can You make any use of my SSL patch sent in on the 23th of August?
>>>>>>>> Andras
>>>>>>>>
>>>>>>>> --
>>>>>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>>>>>> To make changes to your subscription:
>>>>>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>>>> To make changes to your subscription:
>>>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>>>
>>>>>
>>>>
>>>
>>
>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-10 16:21 Bruno Harbulot <bruno@distributedmatter.net>
parent: Bodor András <bodri.mh3@gmail.com>
1 sibling, 1 reply; 13+ messages in thread
From: Bruno Harbulot @ 2011-11-10 16:21 UTC (permalink / raw)
To: pgsql-jdbc; +Cc: Dave Cramer <pg@fastcrypt.com>
Hi all,
Sorry I haven't been able to find the time to try your patch Andras, but
I've been able to read some of the code.
It looks good and it's a good idea to have a more complete set of
parameters that matches the behaviour of libpq as closely as possible.
(I guess one of the questions will be which one should be used by
default, since the Java defaults and the libpq defaults for TLS are
quite different approaches.)
Just a few quick points, if I may:
- I would suggest keeping the use of Subject Alternative Names (as I had
suggested in my patch [1]), to move towards a hostname verification in
line with RFC 6125, keeping the CN check as a fallback solution. A lot
of CAs now issue certificate with a SAN too, and it tends to be a
cleaner way to represent the hostname in general.
This is something that could probably be implemented in libpq too, but I
haven't looked at its code at all unfortunately.
- To avoid the unlikely event of a problem with using "JKS" on line 131
of LibPQFactory.java, this could be used:
KeyStore.getInstance(KeyStore.getDefaultType())
(Just in case this runs in a JRE with a security provider that doesn't
support JKS...)
Perhaps it might be worth considering using 'getDefaultAlgorithm()' when
creating the TrustManager as well.
- I've just noticed that the FileInputStream opened at line 130 of the
LazyKeyManager is never closed.
- I wonder if it might not be simpler to load the user cert and private
key into an in-memory KeyStore and create a KeyManager using it (as it's
done for the TrustManager), via a KeyManagerFactory. This would probably
remove the need to handle the client alias choice manually.
Best wishes,
Bruno.
[1] http://archives.postgresql.org/pgsql-jdbc/2011-08/msg00023.php
On 10/11/2011 14:30, Bodor András wrote:
> Dear Dave,
>
> The installation of sslinfo is only necessary for the unit tests, it is
> not used at all in the driver itself. Obviously I wanted to test weather
> we were actually using ssl, but it is not essential. It can be removed,
> or an additional option can be introduced to ssltest.properties.
> The relevant lines are in
> org.postgresql.test.ssl.SslTest.driver(String connstr, Object[]
> expected)
>
> There are a few things still to be done with this patch.
> 1. the jdbc datasource interface was not modified at all,
> so it is unaware of the new options,
> 2. it should be decided, what is the expected behaviour of sslmode=allow
> or prefer (they might be omitted completely),
> 3. I have not tested certificate chains yet,
> 4. when a client certificate is available, the v8 and v9 servers
> behave differently (BUG #5468 is fixed in v9) so different unit test are
> needed to check this,
> 5. there is a list of options somewhere in the code, this should
> be updated as well,
> 6. documentation.
>
> Andras
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-10 16:54 Dave Cramer <pg@fastcrypt.com>
parent: Bodor András <bodri.mh3@gmail.com>
0 siblings, 0 replies; 13+ messages in thread
From: Dave Cramer @ 2011-11-10 16:54 UTC (permalink / raw)
To: Bodor András <bodri.mh3@gmail.com>; +Cc: pgsql-jdbc
If you could create the certs that would be good. What do we do about
the CA errors ?
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Thu, Nov 10, 2011 at 11:13 AM, Bodor András <bodri.mh3@gmail.com> wrote:
> For the time beeing, you may create new certificates by issuing
>
> openssl req -x509 -newkey -nodes -days 36500 -nodes -keyout server.key
> -out server.crt
>
> they will be good for 100 years. Or shall I send a new patch?
>
> For the question of Magosányi Árpád, rigth now pkcs11 is not supported,
> but it is not a complicated thing. We can return to it, when this patch works.
> Andras
>
> On Thu, Nov 10, 2011 at 4:55 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>> Andras,
>>
>> I noticed that the server.crt in the patch is only good for 1 month
>> and expires in Sept of this year.
>>
>> Dave Cramer
>>
>> dave.cramer(at)credativ(dot)ca
>> http://www.credativ.ca
>>
>>
>>
>>
>> On Thu, Nov 10, 2011 at 10:45 AM, Bodor András <bodri.mh3@gmail.com> wrote:
>>> Can you send me some error log, and your database setup?
>>>
>>> On Thu, Nov 10, 2011 at 4:19 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>>>> Hi Bodor,
>>>>
>>>> Understood.
>>>>
>>>> So now all the tests are failing some due to unknown ca, others to
>>>> certificate expired ?
>>>>
>>>> Dave Cramer
>>>>
>>>> dave.cramer(at)credativ(dot)ca
>>>> http://www.credativ.ca
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Nov 10, 2011 at 9:30 AM, Bodor András <bodri.mh3@gmail.com> wrote:
>>>>> Dear Dave,
>>>>>
>>>>> The installation of sslinfo is only necessary for the unit tests, it is
>>>>> not used at all in the driver itself. Obviously I wanted to test weather
>>>>> we were actually using ssl, but it is not essential. It can be removed,
>>>>> or an additional option can be introduced to ssltest.properties.
>>>>> The relevant lines are in
>>>>> org.postgresql.test.ssl.SslTest.driver(String connstr, Object[]
>>>>> expected)
>>>>>
>>>>> There are a few things still to be done with this patch.
>>>>> 1. the jdbc datasource interface was not modified at all,
>>>>> so it is unaware of the new options,
>>>>> 2. it should be decided, what is the expected behaviour of sslmode=allow
>>>>> or prefer (they might be omitted completely),
>>>>> 3. I have not tested certificate chains yet,
>>>>> 4. when a client certificate is available, the v8 and v9 servers
>>>>> behave differently (BUG #5468 is fixed in v9) so different unit test are
>>>>> needed to check this,
>>>>> 5. there is a list of options somewhere in the code, this should
>>>>> be updated as well,
>>>>> 6. documentation.
>>>>>
>>>>> Andras
>>>>>
>>>>> On Thu, Nov 10, 2011 at 2:56 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>>>>>> Andras,
>>>>>>
>>>>>> I'm looking at your patch attached to this link
>>>>>> http://archives.postgresql.org/pgsql-jdbc/2011-08/msg00067.php right
>>>>>> now. Thanks by the way!
>>>>>>
>>>>>> The only thing I'd like to pose to the list is the necessity for
>>>>>> sslinfo to be installed in any database. I can envision some
>>>>>> production environments which this may not be possible ?
>>>>>>
>>>>>> Dave Cramer
>>>>>>
>>>>>> dave.cramer(at)credativ(dot)ca
>>>>>> http://www.credativ.ca
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Sep 15, 2011 at 11:41 AM, Bodor Andras <bodri.mh3@gmail.com> wrote:
>>>>>>>
>>>>>>> Yes, it is also included in the patch
>>>>>>> (package org.postgresql.test.ssl). It
>>>>>>> tries to connect to a series of databases
>>>>>>> with different ssl properties. The connection
>>>>>>> strings are given in the ssltest.properties
>>>>>>> file in the root of the distribution. Just
>>>>>>> comment out the connstrings, that you don't
>>>>>>> want to run. Also read the certdir/README
>>>>>>> file. (build.xml is modified to run this test.)
>>>>>>> Andras
>>>>>>>
>>>>>>>
>>>>>>> Dave Cramer wrote:
>>>>>>>>
>>>>>>>> Hi Bodor,
>>>>>>>>
>>>>>>>> So do you have any test cases for this ?
>>>>>>>>
>>>>>>>> Dave Cramer
>>>>>>>>
>>>>>>>> dave.cramer(at)credativ(dot)ca
>>>>>>>> http://www.credativ.ca
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2011/9/13 Bodor Andras<bodri.mh3@gmail.com>:
>>>>>>>>>
>>>>>>>>> Hi!
>>>>>>>>>
>>>>>>>>> Can You make any use of my SSL patch sent in on the 23th of August?
>>>>>>>>> Andras
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>>>>>>> To make changes to your subscription:
>>>>>>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>>>>> To make changes to your subscription:
>>>>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: SSL patch
@ 2011-11-16 21:31 Bruno Harbulot <bruno@distributedmatter.net>
parent: Bruno Harbulot <bruno@distributedmatter.net>
0 siblings, 0 replies; 13+ messages in thread
From: Bruno Harbulot @ 2011-11-16 21:31 UTC (permalink / raw)
To: pgsql-jdbc
Hello,
I'm attaching a tentative patch merging the concepts discussed in this
thread (and based on András Bodor's patch) and on the discussion in this
older thread:
http://archives.postgresql.org/pgsql-jdbc/2011-05/msg00069.php
I've tried to resolve the differences between the two approaches: Libpq
and Java JSSE defaults. I guess there are two categories of potential
users for this: users coming from psql and those coming from the Java
world. They'd probably tend to expect different default settings and
options.
This relies on an SslContextFactory and extending classes.
In this patch, SslContextFactory itself isn't actually used (it could be
with a given option). It would use the default SSLContext (which may be
set via SSLContext.setDefault(...) in Java 6 and above, and thus may not
necessarily be the one initialised via the usual javax.* properties).
There's a BasicSslContextFactory (extending SslContextFactory) which
provide methods to create trust managers, key managers and secure
randoms. These are meant to be overridden, otherwise, it will use the
default (null) to initialise the SSLContext (which is the same as using
the JSSE defaults).
It includes convenience methods to build key and trust managers from
KeyStores.
LibPQSslContextFactory extends BasicSslContextFactory and re-uses most
of András's code, initialised from a set of Properties.
This is the one used when 'sslmode' is set. Note that this is where
there would be a conflict regarding the default values (if not testing
for 'sslmode'), since the default CA file is different from what Java
would use as its default.
PropertiesSslContextFactory extends BasicSslContextFactory but is based
on the work by Marc-André Laverdière and Craig Ringer from the previous
thread.
I've also tweaked it to fall back on the default values from the JSSE,
also allowing for non-file-based keystores (e.g. PKCS#11), as discussed
here:
http://archives.postgresql.org/pgsql-jdbc/2011-11/msg00024.php
This one could certainly be modified to use Properties that are not the
System properties, but info passed in the JDBC URL.
Regarding the hostname verification, I've moved András's verifier into a
separate class (DefaultHostnameVerifier). It's used by default unless a
hostname verifier class name is passed or sslmode is set and set to a
value different from 'verify-full' (in which case
PassthroughHostnameVerifier is used). I've also added the SAN verification.
In addition to the 'sslfactory' parameter (which was there, for an
SSLSocketFactory), I've considered adding a parameter for an
SslContextFactory, but haven't. Any opinions? It might make it easier to
pass more complex SSLContexts directly (e.g. via the of the
SSLContextFactories I've done in http://www.jsslutils.org/), but this
could also be done by using a custom SSLSocketFactory.
I must admit it hasn't been extensively tested, but I'd welcome comments
about this approach. I hope this may help unify this work with the
earlier work (sorry, I wasn't aware of it when I first replied to this
thread a few days ago).
Best wishes,
Bruno.
Attachments:
0001-Using-SSLContext-Factories-and-merging-concepts-of-t.patch.gz (application/x-gzip, 21.2K) download
^ permalink raw reply [nested|flat] 13+ messages in thread
end of thread, other threads:[~2011-11-16 21:31 UTC | newest]
Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13 18:41 SSL patch Bodor Andras <bodri.mh3@gmail.com>
2011-09-15 11:47 ` Dave Cramer <pg@fastcrypt.com>
2011-09-15 15:41 ` Bodor Andras <bodri.mh3@gmail.com>
2011-11-10 13:56 ` Dave Cramer <pg@fastcrypt.com>
2011-11-10 14:30 ` Bodor András <bodri.mh3@gmail.com>
2011-11-10 15:19 ` Dave Cramer <pg@fastcrypt.com>
2011-11-10 15:45 ` Bodor András <bodri.mh3@gmail.com>
2011-11-10 15:55 ` Dave Cramer <pg@fastcrypt.com>
2011-11-10 16:13 ` Bodor András <bodri.mh3@gmail.com>
2011-11-10 16:54 ` Dave Cramer <pg@fastcrypt.com>
2011-11-10 16:21 ` Bruno Harbulot <bruno@distributedmatter.net>
2011-11-16 21:31 ` Bruno Harbulot <bruno@distributedmatter.net>
2011-11-10 14:46 ` Magosányi Árpád <mag@magwas.rulez.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox