mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-17 19:30:00 +08:00
Fix pg_stat_ssl.clientdn
Return null if there is no client certificate. This is how it has always been documented, but in reality it returned an empty string. Reviewed-by: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> Discussion: https://www.postgresql.org/message-id/flat/398754d8-6bb5-c5cf-e7b8-22e5f0983caf@2ndquadrant.com/
This commit is contained in:
parent
18059543e7
commit
e77cfa54d7
@ -652,7 +652,10 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
|
||||
values[20] = CStringGetTextDatum(beentry->st_sslstatus->ssl_cipher);
|
||||
values[21] = Int32GetDatum(beentry->st_sslstatus->ssl_bits);
|
||||
values[22] = BoolGetDatum(beentry->st_sslstatus->ssl_compression);
|
||||
values[23] = CStringGetTextDatum(beentry->st_sslstatus->ssl_clientdn);
|
||||
if (beentry->st_sslstatus->ssl_clientdn[0])
|
||||
values[23] = CStringGetTextDatum(beentry->st_sslstatus->ssl_clientdn);
|
||||
else
|
||||
nulls[23] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -316,7 +316,7 @@ command_like([
|
||||
'-c', "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
|
||||
],
|
||||
qr{^pid,ssl,version,cipher,bits,compression,clientdn\n
|
||||
^\d+,t,TLSv[\d.]+,[\w-]+,\d+,f,$}mx,
|
||||
^\d+,t,TLSv[\d.]+,[\w-]+,\d+,f,_null_$}mx,
|
||||
'pg_stat_ssl view without client certificate');
|
||||
|
||||
### Server-side tests.
|
||||
|
Loading…
Reference in New Issue
Block a user