pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ravi Krishna <srkrishna@usa.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: New behavior with JDBC 42.2.5
Date: Fri, 21 Sep 2018 19:13:15 -0700
Message-ID: <d4569662-3deb-7a23-3eb7-ae0d86a8ce71@aklaver.com> (raw)
In-Reply-To: <trinity-33c46c85-c1a1-45d9-8b6b-1ad547c9227a-1537577217218@3c-app-mailcom-lxa09>
References: <CAJCZko++xfddUpwC34FwPRvoK_9mEBecYY2eKUyvHnqNanND5w@mail.gmail.com>
	<b67da906-d4dc-72c9-247e-576c934ce174@a-kretschmer.de>
	<CAJCZkoJr_ro=w8OMq8Ge0vZY8u4tggOG+U35Tisz67Y+qLosvg@mail.gmail.com>
	<CAJCZko+bB03wvLGVLJ3-JWUqaUWyKeZ5M2z=iLLHjOtJ_oQXQQ@mail.gmail.com>
	<CAJCZkoL63tYMBDwO-xaTqjDJ5ZzyCsz4zj-87DQ1vucMEmBxZQ@mail.gmail.com>
	<CAF-3MvOyLi55OOxoMAkvc998Bz20+XzWZXxPBHy-5Xa6n1m2vg@mail.gmail.com>
	<CAJCZkoKEbkeitrTDLBomioEaA_R843c4XRxOjEATe27yjEh_2w@mail.gmail.com>
	<CAJCZkoKnRJ+NrvTS0A5UUnJ1OY5-LJOWcgAeJ9Uef6x8WMCfiw@mail.gmail.com>
	<d42b255d-a758-437b-ed4b-e86d77b6af9f@a-kretschmer.de>
	<CAJCZkoLuCYJ37kS4Z=6+XFd9qMY4ZcEnLiRZUZVsPq=eeCqOaA@mail.gmail.com>
	<ef43454b-00e1-255a-08be-32f9de50b6c0@a-kretschmer.de>
	<trinity-cc97ba76-0fee-4a21-8a9f-0e152702b959-1537549924412@3c-app-mailcom-lxa07>
	<36f554cb-d8c2-5ebc-7f6d-0080effbae4e@aklaver.com>
	<trinity-33c46c85-c1a1-45d9-8b6b-1ad547c9227a-1537577217218@3c-app-mailcom-lxa09>

On 9/21/18 5:46 PM, Ravi Krishna wrote:
>> First are doing a socket connection or a host connection? Socket
>> connections ignore sslmode.
> 
> The URL template of JDBC used by dbeaver is jdbc:postgresql://{host}[:{port}]/[{database}]
> 
>>From the manual
> 
> "The host component is interpreted as described for the parameter host. In particular, a Unix-domain socket connection is chosen if the host part is either empty or starts with a slash, otherwise a TCP/IP connection is initiated."
> 
> In our case the host name does not start with a slash.  So I conclude it is using TCP/IP.
> 
> 
>> psql postgresql://localhost:5432/test?sslmode=require
>>
>>
>> psql postgresql://localhost:5432/test?sslmode=disable
> 
> We are using dbeaver, not psql. dbeaver also provides disable option for sslmode.  I set sslmode=disable and it immediately rejected connection with error "SSL Mode off".
> 
> So the puzzle is -> in version 42.1.4 when we do not check "Use SSL " button, connection
> fails with "SSL Mode off". In that version we check the box "Use SSL" and then in the dropdown
> for sslmode, we select sslmode=require. Only then the connection passes.
> 
> In version 42.2.5 even if we do not check "Use SSL" it still behaves the same as
> "Use SSL" checked and sslmode=require.
> 
> I was not able to import the security bulletin fully, but am I right in concluding
> that JDBC 42.2.5 always turns on sslmode=require unless we explicitly set sslmode=disable.

Looks that way:

https://github.com/pgjdbc/pgjdbc/commit/cdeeaca47dc3bc6f727c79a582c9e4123099526e

Line 181-184

  * Parameter governing the use of SSL. The allowed values are {@code 
disable}, {@code allow},
    * {@code prefer}, {@code require}, {@code verify-ca}, {@code 
verify-full}.
    * If {@code ssl} property is empty or set to {@code true} it implies 
{@code verify-full}.
    * Default mode is "require"

> 
> Thanks for your help.
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (5+ messages)

Message-ID: <d4569662-3deb-7a23-3eb7-ae0d86a8ce71@aklaver.com>
Permalink:  ../d4569662-3deb-7a23-3eb7-ae0d86a8ce71@aklaver.com/
Also on:    postgresql.org/message-id/d4569662-3deb-7a23-3eb7-ae0d86a8ce71@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, srkrishna@usa.com
  Subject: Re: New behavior with JDBC 42.2.5
  In-Reply-To: <d4569662-3deb-7a23-3eb7-ae0d86a8ce71@aklaver.com>
  References: <CAJCZko++xfddUpwC34FwPRvoK_9mEBecYY2eKUyvHnqNanND5w@mail.gmail.com> <b67da906-d4dc-72c9-247e-576c934ce174@a-kretschmer.de> <CAJCZkoJr_ro=w8OMq8Ge0vZY8u4tggOG+U35Tisz67Y+qLosvg@mail.gmail.com> <CAJCZko+bB03wvLGVLJ3-JWUqaUWyKeZ5M2z=iLLHjOtJ_oQXQQ@mail.gmail.com> <CAJCZkoL63tYMBDwO-xaTqjDJ5ZzyCsz4zj-87DQ1vucMEmBxZQ@mail.gmail.com> <CAF-3MvOyLi55OOxoMAkvc998Bz20+XzWZXxPBHy-5Xa6n1m2vg@mail.gmail.com> <CAJCZkoKEbkeitrTDLBomioEaA_R843c4XRxOjEATe27yjEh_2w@mail.gmail.com> <CAJCZkoKnRJ+NrvTS0A5UUnJ1OY5-LJOWcgAeJ9Uef6x8WMCfiw@mail.gmail.com> <d42b255d-a758-437b-ed4b-e86d77b6af9f@a-kretschmer.de> <CAJCZkoLuCYJ37kS4Z=6+XFd9qMY4ZcEnLiRZUZVsPq=eeCqOaA@mail.gmail.com> <ef43454b-00e1-255a-08be-32f9de50b6c0@a-kretschmer.de> <trinity-cc97ba76-0fee-4a21-8a9f-0e152702b959-1537549924412@3c-app-mailcom-lxa07> <36f554cb-d8c2-5ebc-7f6d-0080effbae4e@aklaver.com> <trinity-33c46c85-c1a1-45d9-8b6b-1ad547c9227a-1537577217218@3c-app-mailcom-lxa09> <d4569662-3deb-7a23-3eb7-ae0d86a8ce71@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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