pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Difference between host, hostssl and hostnossl connection type
5+ messages / 2 participants
[nested] [flat]

* Difference between host, hostssl and hostnossl connection type
@ 2022-11-25 05:21  Dhirendra Singh <dhirendraks@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Dhirendra Singh @ 2022-11-25 05:21 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi All,
I am using postgres version 14.
I would like to know what is the difference between host, hostssl and
hostnossl connection type.
According to documentation,
host => This record matches connection attempts made using TCP/IP. host
records match SSL or non-SSL connection attempts as well as GSSAPI
encrypted or non-GSSAPI encrypted connection
attempts.
hostssl => This record matches connection attempts made using TCP/IP, but
only when the connection is made with SSL encryption.
hostnossl => This record type has the opposite behavior of hostssl; it only
matches connection attempts made over TCP/IP that do not use SSL.

I provided cert authentication method for host type connection. but i get
error and postgres does not come up. Following is the error message i get.
LOG: cert authentication is only supported on hostssl connections.

Thanks,
Dhirendra.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Difference between host, hostssl and hostnossl connection type
@ 2022-11-25 07:09  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Dhirendra Singh <dhirendraks@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Laurenz Albe @ 2022-11-25 07:09 UTC (permalink / raw)
  To: Dhirendra Singh <dhirendraks@gmail.com>; pgsql-admin@lists.postgresql.org

On Fri, 2022-11-25 at 10:51 +0530, Dhirendra Singh wrote:
> I am using postgres version 14.
> I would like to know what is the difference between host, hostssl and hostnossl connection type.
> According to documentation,
> host => This record matches connection attempts made using TCP/IP. host records match SSL or non-SSL
>         connection attempts as well as GSSAPI encrypted or non-GSSAPI encrypted connection
> attempts.
> hostssl => This record matches connection attempts made using TCP/IP, but only when the connection
>            is made with SSL encryption.
> hostnossl => This record type has the opposite behavior of hostssl; it only matches connection
>              attempts made over TCP/IP that do not use SSL.
> 
> I provided cert authentication method for host type connection. but i get error and postgres
> does not come up. Following is the error message i get.
> LOG: cert authentication is only supported on hostssl connections.

"cert" authentication is authentication with SSL (TLS) certificates.
You cannot use that authentication without SSL.  That is why you have to use "hostssl".

Yours,
Laurenz Albe





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Difference between host, hostssl and hostnossl connection type
@ 2022-11-25 07:27  Dhirendra Singh <dhirendraks@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 5+ messages in thread

From: Dhirendra Singh @ 2022-11-25 07:27 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-admin@lists.postgresql.org

But if i provide cert authentication in host type and provide certificates
then it should work.no ?
Otherwise the documentation is not clear about this limitation.

Thanks,
Dhirendra.

On Fri, Nov 25, 2022 at 12:39 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:

> On Fri, 2022-11-25 at 10:51 +0530, Dhirendra Singh wrote:
> > I am using postgres version 14.
> > I would like to know what is the difference between host, hostssl and
> hostnossl connection type.
> > According to documentation,
> > host => This record matches connection attempts made using TCP/IP. host
> records match SSL or non-SSL
> >         connection attempts as well as GSSAPI encrypted or non-GSSAPI
> encrypted connection
> > attempts.
> > hostssl => This record matches connection attempts made using TCP/IP,
> but only when the connection
> >            is made with SSL encryption.
> > hostnossl => This record type has the opposite behavior of hostssl; it
> only matches connection
> >              attempts made over TCP/IP that do not use SSL.
> >
> > I provided cert authentication method for host type connection. but i
> get error and postgres
> > does not come up. Following is the error message i get.
> > LOG: cert authentication is only supported on hostssl connections.
>
> "cert" authentication is authentication with SSL (TLS) certificates.
> You cannot use that authentication without SSL.  That is why you have to
> use "hostssl".
>
> Yours,
> Laurenz Albe
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Difference between host, hostssl and hostnossl connection type
@ 2022-11-25 07:44  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Dhirendra Singh <dhirendraks@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Laurenz Albe @ 2022-11-25 07:44 UTC (permalink / raw)
  To: Dhirendra Singh <dhirendraks@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org

On Fri, 2022-11-25 at 12:57 +0530, Dhirendra Singh wrote:
> But if i provide cert authentication in host type and provide certificates then it should work.no ?
> Otherwise the documentation is not clear about this limitation.

I think that the documentation (https://www.postgresql.org/docs/current/auth-cert.html)
is quite clear:

> This authentication method uses SSL client certificates to perform authentication.
> It is therefore only available for SSL connections.

True, it doesn't spell out that you will get an error if you use it with "host",
but the error message was clear enough, wasn't it?

Yours,
Laurenz Albe





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Difference between host, hostssl and hostnossl connection type
@ 2022-11-25 08:50  Dhirendra Singh <dhirendraks@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 5+ messages in thread

From: Dhirendra Singh @ 2022-11-25 08:50 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-admin@lists.postgresql.org

yes. The error message was clear.
but by reading the documentation it was not clear to me that it can't be
used with host connection type.
Thanks for your time.

On Fri, Nov 25, 2022 at 1:14 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:

> On Fri, 2022-11-25 at 12:57 +0530, Dhirendra Singh wrote:
> > But if i provide cert authentication in host type and provide
> certificates then it should work.no ?
> > Otherwise the documentation is not clear about this limitation.
>
> I think that the documentation (
> https://www.postgresql.org/docs/current/auth-cert.html)
> is quite clear:
>
> > This authentication method uses SSL client certificates to perform
> authentication.
> > It is therefore only available for SSL connections.
>
> True, it doesn't spell out that you will get an error if you use it with
> "host",
> but the error message was clear enough, wasn't it?
>
> Yours,
> Laurenz Albe
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2022-11-25 08:50 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-11-25 05:21 Difference between host, hostssl and hostnossl connection type Dhirendra Singh <dhirendraks@gmail.com>
2022-11-25 07:09 ` Laurenz Albe <laurenz.albe@cybertec.at>
2022-11-25 07:27   ` Dhirendra Singh <dhirendraks@gmail.com>
2022-11-25 07:44     ` Laurenz Albe <laurenz.albe@cybertec.at>
2022-11-25 08:50       ` Dhirendra Singh <dhirendraks@gmail.com>

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