0004-nss-add-client-error-for-unexpected-EOF.patch

text/x-patch

Filename: 0004-nss-add-client-error-for-unexpected-EOF.patch
Type: text/x-patch
Part: 3
Message: Re: Support for NSS as a libpq TLS backend

Patch

Format: format-patch
Series: patch 0004
Subject: nss: add client error for unexpected-EOF
File+
src/interfaces/libpq/fe-secure-nss.c 2 0
From 17f0cfc86a9b458d4cc964b6a1736f3b2870cf23 Mon Sep 17 00:00:00 2001
From: Jacob Champion <pchampion@vmware.com>
Date: Mon, 19 Jul 2021 12:16:17 -0700
Subject: [PATCH 4/4] nss: add client error for unexpected-EOF

...to mirror that of the OpenSSL implementation.
---
 src/interfaces/libpq/fe-secure-nss.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/interfaces/libpq/fe-secure-nss.c b/src/interfaces/libpq/fe-secure-nss.c
index 4490fb03e4..67dff8b724 100644
--- a/src/interfaces/libpq/fe-secure-nss.c
+++ b/src/interfaces/libpq/fe-secure-nss.c
@@ -488,6 +488,8 @@ pgtls_read(PGconn *conn, void *ptr, size_t len)
 
 	if (nread == 0)
 	{
+		appendPQExpBufferStr(&conn->errorMessage,
+							 libpq_gettext("TLS read error: EOF detected\n"));
 		read_errno = ECONNRESET;
 		nread = -1;
 	}
-- 
2.25.1