Description: Fix tests for architectures without AES hardware support
 Starting with Go 1.16, ChaCha (TLS_CHACHA20_POLY1305_SHA256)
 is picked over AES (TLS_AES_128_GCM_SHA256) for TLS 1.3 on machines
 that do not have AES hardware support, e.g. on armhf, 386 and ppc64le,
 as caught by Debian autopkgtest for golang-github-henvic-httpretty/0.0.6-2
 since November 2021.
 .
 This patch accommodates TLS_CHACHA20_POLY1305_SHA256 in addition to
 TLS_AES_128_GCM_SHA256 in the TLS 1.3 tests.
Author: Anthony Fok <foka@debian.org>
Bug: https://github.com/henvic/httpretty/pull/12
Last-Update: 2022-04-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
 client_test.go | 6 +++---
 server_test.go | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/client_test.go b/client_test.go
index 1ec6ea8..4eb4042 100644
--- a/client_test.go
+++ b/client_test.go
@@ -1800,7 +1800,7 @@ func TestOutgoingTLS(t *testing.T) {
 Hello, world!
 `, ts.URL)
 
-	if got := buf.String(); got != want {
+	if got := strings.Replace(buf.String(), "TLS_CHACHA20_POLY1305_SHA256", "TLS_AES_128_GCM_SHA256", -1); got != want {
 		t.Errorf("logged HTTP request %s; want %s", got, want)
 	}
 
@@ -1867,7 +1867,7 @@ func TestOutgoingTLSInsecureSkipVerify(t *testing.T) {
 Hello, world!
 `, ts.URL)
 
-	got := buf.String()
+	got := strings.Replace(buf.String(), "TLS_CHACHA20_POLY1305_SHA256", "TLS_AES_128_GCM_SHA256", -1)
 
 	if got != want {
 		t.Errorf("logged HTTP request %s; want %s", got, want)
@@ -2147,7 +2147,7 @@ func TestOutgoingHTTP2MutualTLS(t *testing.T) {
 Hello, world!
 `, host, port)
 
-	if got := buf.String(); got != want {
+	if got := strings.Replace(buf.String(), "TLS_CHACHA20_POLY1305_SHA256", "TLS_AES_128_GCM_SHA256", -1); got != want {
 		t.Errorf("logged HTTP request %s; want %s", got, want)
 	}
 }
diff --git a/server_test.go b/server_test.go
index 953c1ea..7844c93 100644
--- a/server_test.go
+++ b/server_test.go
@@ -1703,7 +1703,7 @@ func TestIncomingTLS(t *testing.T) {
 Hello, world!
 `, is.req.RemoteAddr)
 
-	if got := buf.String(); got != want {
+	if got := strings.Replace(buf.String(), "TLS_CHACHA20_POLY1305_SHA256", "TLS_AES_128_GCM_SHA256", -1); got != want {
 		t.Errorf("logged HTTP request %s; want %s", got, want)
 	}
 }
@@ -1847,7 +1847,7 @@ func TestIncomingMutualTLS(t *testing.T) {
 Hello, world!
 `, host, is.req.RemoteAddr, port)
 
-	if got := buf.String(); got != want {
+	if got := strings.Replace(buf.String(), "TLS_CHACHA20_POLY1305_SHA256", "TLS_AES_128_GCM_SHA256", -1); got != want {
 		t.Errorf("logged HTTP request %s; want %s", got, want)
 	}
 }
-- 
2.35.1

