From 6c0d5e4b65d84bc97cc9b1b5e3033a08355f36b6 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 23 May 2022 14:36:11 +0100 Subject: [PATCH] alias: Enable self signed TLS prompt in darwin platforms (#4094) Not trusted TLS error message has another string representation in Darwin platform. Since there is no another way to test for this specific error with Golang API, we will need to support this alternate error message. --- cmd/tofu.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/tofu.go b/cmd/tofu.go index 5a0dec68..3001f35d 100644 --- a/cmd/tofu.go +++ b/cmd/tofu.go @@ -102,7 +102,8 @@ func promptTrustSelfSignedCert(ctx context.Context, endpoint, alias string) (*x5 return nil, nil } - if te != nil && !strings.Contains(te.Error(), "certificate signed by unknown authority") { + if te != nil && !strings.Contains(te.Error(), "certificate signed by unknown authority") && + !strings.Contains(te.Error(), "certificate is not trusted") /* darwin specific error message */ { return nil, probe.NewError(te) }