Blame SOURCES/0013-curl-7.76.1-CVE-2022-27774.patch

372e18
From ecee0926868d138312e9608531b232f697e50cad Mon Sep 17 00:00:00 2001
372e18
From: Daniel Stenberg <daniel@haxx.se>
372e18
Date: Mon, 25 Apr 2022 16:24:33 +0200
372e18
Subject: [PATCH 1/4] connect: store "conn_remote_port" in the info struct
372e18
372e18
To make it available after the connection ended.
372e18
372e18
Upstream-commit: 08b8ef4e726ba10f45081ecda5b3cea788d3c839
372e18
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
372e18
---
372e18
 lib/connect.c | 1 +
372e18
 lib/urldata.h | 6 +++++-
372e18
 2 files changed, 6 insertions(+), 1 deletion(-)
372e18
372e18
diff --git a/lib/connect.c b/lib/connect.c
372e18
index 64f9511..7518807 100644
372e18
--- a/lib/connect.c
372e18
+++ b/lib/connect.c
372e18
@@ -619,6 +619,7 @@ void Curl_persistconninfo(struct Curl_easy *data, struct connectdata *conn,
372e18
   data->info.conn_scheme = conn->handler->scheme;
372e18
   data->info.conn_protocol = conn->handler->protocol;
372e18
   data->info.conn_primary_port = conn->port;
372e18
+  data->info.conn_remote_port = conn->remote_port;
372e18
   data->info.conn_local_port = local_port;
372e18
 }
372e18
 
372e18
diff --git a/lib/urldata.h b/lib/urldata.h
372e18
index f92052a..5218f76 100644
372e18
--- a/lib/urldata.h
372e18
+++ b/lib/urldata.h
372e18
@@ -1167,7 +1167,11 @@ struct PureInfo {
372e18
      reused, in the connection cache. */
372e18
 
372e18
   char conn_primary_ip[MAX_IPADR_LEN];
372e18
-  int conn_primary_port;
372e18
+  int conn_primary_port; /* this is the destination port to the connection,
372e18
+                            which might have been a proxy */
372e18
+  int conn_remote_port;  /* this is the "remote port", which is the port
372e18
+                            number of the used URL, independent of proxy or
372e18
+                            not */
372e18
   char conn_local_ip[MAX_IPADR_LEN];
372e18
   int conn_local_port;
372e18
   const char *conn_scheme;
372e18
-- 
372e18
2.34.1
372e18
372e18
372e18
From 12c129f8d0b165d83ed954f68717d88ffc1cfc5f Mon Sep 17 00:00:00 2001
372e18
From: Daniel Stenberg <daniel@haxx.se>
372e18
Date: Mon, 25 Apr 2022 16:24:33 +0200
372e18
Subject: [PATCH 2/4] transfer: redirects to other protocols or ports clear
372e18
 auth
372e18
372e18
... unless explicitly permitted.
372e18
372e18
Bug: https://curl.se/docs/CVE-2022-27774.html
372e18
Reported-by: Harry Sintonen
372e18
Closes #8748
372e18
372e18
Upstream-commit: 620ea21410030a9977396b4661806bc187231b79
372e18
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
372e18
---
372e18
 lib/transfer.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
372e18
 1 file changed, 48 insertions(+), 1 deletion(-)
372e18
372e18
diff --git a/lib/transfer.c b/lib/transfer.c
372e18
index 1f8019b..752fe14 100644
372e18
--- a/lib/transfer.c
372e18
+++ b/lib/transfer.c
372e18
@@ -1641,10 +1641,57 @@ CURLcode Curl_follow(struct Curl_easy *data,
372e18
       return CURLE_OUT_OF_MEMORY;
372e18
   }
372e18
   else {
372e18
-
372e18
     uc = curl_url_get(data->state.uh, CURLUPART_URL, &newurl, 0);
372e18
     if(uc)
372e18
       return Curl_uc_to_curlcode(uc);
372e18
+
372e18
+    /* Clear auth if this redirects to a different port number or protocol,
372e18
+       unless permitted */
372e18
+    if(!data->set.allow_auth_to_other_hosts && (type != FOLLOW_FAKE)) {
372e18
+      char *portnum;
372e18
+      int port;
372e18
+      bool clear = FALSE;
372e18
+
372e18
+      if(data->set.use_port && data->state.allow_port)
372e18
+        /* a custom port is used */
372e18
+        port = (int)data->set.use_port;
372e18
+      else {
372e18
+        uc = curl_url_get(data->state.uh, CURLUPART_PORT, &portnum,
372e18
+                          CURLU_DEFAULT_PORT);
372e18
+        if(uc) {
372e18
+          free(newurl);
372e18
+          return Curl_uc_to_curlcode(uc);
372e18
+        }
372e18
+        port = atoi(portnum);
372e18
+        free(portnum);
372e18
+      }
372e18
+      if(port != data->info.conn_remote_port) {
372e18
+        infof(data, "Clear auth, redirects to port from %u to %u",
372e18
+              data->info.conn_remote_port, port);
372e18
+        clear = TRUE;
372e18
+      }
372e18
+      else {
372e18
+        char *scheme;
372e18
+        const struct Curl_handler *p;
372e18
+        uc = curl_url_get(data->state.uh, CURLUPART_SCHEME, &scheme, 0);
372e18
+        if(uc) {
372e18
+          free(newurl);
372e18
+          return Curl_uc_to_curlcode(uc);
372e18
+        }
372e18
+
372e18
+        p = Curl_builtin_scheme(scheme);
372e18
+        if(p && (p->protocol != data->info.conn_protocol)) {
372e18
+          infof(data, "Clear auth, redirects scheme from %s to %s",
372e18
+                data->info.conn_scheme, scheme);
372e18
+          clear = TRUE;
372e18
+        }
372e18
+        free(scheme);
372e18
+      }
372e18
+      if(clear) {
372e18
+        Curl_safefree(data->state.aptr.user);
372e18
+        Curl_safefree(data->state.aptr.passwd);
372e18
+      }
372e18
+    }
372e18
   }
372e18
 
372e18
   if(type == FOLLOW_FAKE) {
372e18
-- 
372e18
2.34.1
372e18
372e18
372e18
From 83bf4314d88cc16469afeaaefd6686a50371d1b7 Mon Sep 17 00:00:00 2001
372e18
From: Daniel Stenberg <daniel@haxx.se>
372e18
Date: Mon, 25 Apr 2022 16:24:33 +0200
372e18
Subject: [PATCH 3/4] tests: verify the fix for CVE-2022-27774
372e18
372e18
 - Test 973 redirects from HTTP to FTP, clear auth
372e18
 - Test 974 redirects from HTTP to HTTP different port, clear auth
372e18
 - Test 975 redirects from HTTP to FTP, permitted to keep auth
372e18
 - Test 976 redirects from HTTP to HTTP different port, permitted to keep
372e18
   auth
372e18
372e18
Upstream-commit: 5295e8d64ac6949ecb3f9e564317a608f51b90d8
372e18
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
372e18
---
372e18
 tests/data/Makefile.inc |  1 +
372e18
 tests/data/test973      | 88 +++++++++++++++++++++++++++++++++++++++++
372e18
 tests/data/test974      | 87 ++++++++++++++++++++++++++++++++++++++++
372e18
 tests/data/test975      | 88 +++++++++++++++++++++++++++++++++++++++++
372e18
 tests/data/test976      | 88 +++++++++++++++++++++++++++++++++++++++++
372e18
 5 files changed, 352 insertions(+)
372e18
 create mode 100644 tests/data/test973
372e18
 create mode 100644 tests/data/test974
372e18
 create mode 100644 tests/data/test975
372e18
 create mode 100644 tests/data/test976
372e18
372e18
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
372e18
index 7ae2cf8..175fc43 100644
372e18
--- a/tests/data/Makefile.inc
372e18
+++ b/tests/data/Makefile.inc
372e18
@@ -116,6 +116,7 @@ test936 test937 test938 test939 test940 test941 test942 test943 test944 \
372e18
 test945 test946 test947 test948 test949 test950 test951 test952 test953 \
372e18
 test954 test955 test956 test957 test958 test959 test960 test961 test962 \
372e18
 test963 test964 test965 test966 test967 test968 test969 test970 test971 \
372e18
+test973 test974 test975 test976 \
372e18
 \
372e18
 test980 test981 test982 test983 test984 test985 test986 \
372e18
 \
372e18
diff --git a/tests/data/test973 b/tests/data/test973
372e18
new file mode 100644
372e18
index 0000000..6ced107
372e18
--- /dev/null
372e18
+++ b/tests/data/test973
372e18
@@ -0,0 +1,88 @@
372e18
+<testcase>
372e18
+<info>
372e18
+<keywords>
372e18
+HTTP
372e18
+FTP
372e18
+--location
372e18
+</keywords>
372e18
+</info>
372e18
+
372e18
+#
372e18
+# Server-side
372e18
+<reply>
372e18
+<data>
372e18
+HTTP/1.1 301 redirect
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 0
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+Location: ftp://%HOSTIP:%FTPPORT/a/path/%TESTNUMBER0002
372e18
+
372e18
+</data>
372e18
+<data2>
372e18
+data
372e18
+    to
372e18
+      see
372e18
+that FTP
372e18
+works
372e18
+  so does it?
372e18
+</data2>
372e18
+
372e18
+<datacheck>
372e18
+HTTP/1.1 301 redirect
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 0
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+Location: ftp://%HOSTIP:%FTPPORT/a/path/%TESTNUMBER0002
372e18
+
372e18
+data
372e18
+    to
372e18
+      see
372e18
+that FTP
372e18
+works
372e18
+  so does it?
372e18
+</datacheck>
372e18
+
372e18
+</reply>
372e18
+
372e18
+#
372e18
+# Client-side
372e18
+<client>
372e18
+<server>
372e18
+http
372e18
+ftp
372e18
+</server>
372e18
+ <name>
372e18
+HTTP with auth redirected to FTP w/o auth
372e18
+ </name>
372e18
+ <command>
372e18
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER -L -u joe:secret
372e18
+</command>
372e18
+</client>
372e18
+
372e18
+#
372e18
+# Verify data after the test has been "shot"
372e18
+<verify>
372e18
+<protocol>
372e18
+GET /%TESTNUMBER HTTP/1.1
372e18
+Host: %HOSTIP:%HTTPPORT
372e18
+Authorization: Basic am9lOnNlY3JldA==
372e18
+User-Agent: curl/%VERSION
372e18
+Accept: */*
372e18
+
372e18
+USER anonymous
372e18
+PASS ftp@example.com
372e18
+PWD
372e18
+CWD a
372e18
+CWD path
372e18
+EPSV
372e18
+TYPE I
372e18
+SIZE %TESTNUMBER0002
372e18
+RETR %TESTNUMBER0002
372e18
+QUIT
372e18
+</protocol>
372e18
+</verify>
372e18
+</testcase>
372e18
diff --git a/tests/data/test974 b/tests/data/test974
372e18
new file mode 100644
372e18
index 0000000..ac4e641
372e18
--- /dev/null
372e18
+++ b/tests/data/test974
372e18
@@ -0,0 +1,87 @@
372e18
+<testcase>
372e18
+<info>
372e18
+<keywords>
372e18
+HTTP
372e18
+--location
372e18
+</keywords>
372e18
+</info>
372e18
+
372e18
+#
372e18
+# Server-side
372e18
+<reply>
372e18
+<data>
372e18
+HTTP/1.1 301 redirect
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 0
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+Location: http://firsthost.com:9999/a/path/%TESTNUMBER0002
372e18
+
372e18
+</data>
372e18
+<data2>
372e18
+HTTP/1.1 200 OK
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 4
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+
372e18
+hey
372e18
+</data2>
372e18
+
372e18
+<datacheck>
372e18
+HTTP/1.1 301 redirect
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 0
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+Location: http://firsthost.com:9999/a/path/%TESTNUMBER0002
372e18
+
372e18
+HTTP/1.1 200 OK
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 4
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+
372e18
+hey
372e18
+</datacheck>
372e18
+
372e18
+</reply>
372e18
+
372e18
+#
372e18
+# Client-side
372e18
+<client>
372e18
+<server>
372e18
+http
372e18
+</server>
372e18
+ <name>
372e18
+HTTP with auth redirected to HTTP on a diff port w/o auth
372e18
+ </name>
372e18
+ <command>
372e18
+-x http://%HOSTIP:%HTTPPORT http://firsthost.com -L -u joe:secret
372e18
+</command>
372e18
+</client>
372e18
+
372e18
+#
372e18
+# Verify data after the test has been "shot"
372e18
+<verify>
372e18
+<protocol>
372e18
+GET http://firsthost.com/ HTTP/1.1
372e18
+Host: firsthost.com
372e18
+Authorization: Basic am9lOnNlY3JldA==
372e18
+User-Agent: curl/%VERSION
372e18
+Accept: */*
372e18
+Proxy-Connection: Keep-Alive
372e18
+
372e18
+GET http://firsthost.com:9999/a/path/%TESTNUMBER0002 HTTP/1.1
372e18
+Host: firsthost.com:9999
372e18
+User-Agent: curl/%VERSION
372e18
+Accept: */*
372e18
+Proxy-Connection: Keep-Alive
372e18
+
372e18
+</protocol>
372e18
+</verify>
372e18
+</testcase>
372e18
diff --git a/tests/data/test975 b/tests/data/test975
372e18
new file mode 100644
372e18
index 0000000..85e03e4
372e18
--- /dev/null
372e18
+++ b/tests/data/test975
372e18
@@ -0,0 +1,88 @@
372e18
+<testcase>
372e18
+<info>
372e18
+<keywords>
372e18
+HTTP
372e18
+FTP
372e18
+--location-trusted
372e18
+</keywords>
372e18
+</info>
372e18
+
372e18
+#
372e18
+# Server-side
372e18
+<reply>
372e18
+<data>
372e18
+HTTP/1.1 301 redirect
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 0
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+Location: ftp://%HOSTIP:%FTPPORT/a/path/%TESTNUMBER0002
372e18
+
372e18
+</data>
372e18
+<data2>
372e18
+data
372e18
+    to
372e18
+      see
372e18
+that FTP
372e18
+works
372e18
+  so does it?
372e18
+</data2>
372e18
+
372e18
+<datacheck>
372e18
+HTTP/1.1 301 redirect
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 0
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+Location: ftp://%HOSTIP:%FTPPORT/a/path/%TESTNUMBER0002
372e18
+
372e18
+data
372e18
+    to
372e18
+      see
372e18
+that FTP
372e18
+works
372e18
+  so does it?
372e18
+</datacheck>
372e18
+
372e18
+</reply>
372e18
+
372e18
+#
372e18
+# Client-side
372e18
+<client>
372e18
+<server>
372e18
+http
372e18
+ftp
372e18
+</server>
372e18
+ <name>
372e18
+HTTP with auth redirected to FTP allowing auth to continue
372e18
+ </name>
372e18
+ <command>
372e18
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER --location-trusted -u joe:secret
372e18
+</command>
372e18
+</client>
372e18
+
372e18
+#
372e18
+# Verify data after the test has been "shot"
372e18
+<verify>
372e18
+<protocol>
372e18
+GET /%TESTNUMBER HTTP/1.1
372e18
+Host: %HOSTIP:%HTTPPORT
372e18
+Authorization: Basic am9lOnNlY3JldA==
372e18
+User-Agent: curl/%VERSION
372e18
+Accept: */*
372e18
+
372e18
+USER joe
372e18
+PASS secret
372e18
+PWD
372e18
+CWD a
372e18
+CWD path
372e18
+EPSV
372e18
+TYPE I
372e18
+SIZE %TESTNUMBER0002
372e18
+RETR %TESTNUMBER0002
372e18
+QUIT
372e18
+</protocol>
372e18
+</verify>
372e18
+</testcase>
372e18
diff --git a/tests/data/test976 b/tests/data/test976
372e18
new file mode 100644
372e18
index 0000000..c4dd61e
372e18
--- /dev/null
372e18
+++ b/tests/data/test976
372e18
@@ -0,0 +1,88 @@
372e18
+<testcase>
372e18
+<info>
372e18
+<keywords>
372e18
+HTTP
372e18
+--location-trusted
372e18
+</keywords>
372e18
+</info>
372e18
+
372e18
+#
372e18
+# Server-side
372e18
+<reply>
372e18
+<data>
372e18
+HTTP/1.1 301 redirect
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 0
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+Location: http://firsthost.com:9999/a/path/%TESTNUMBER0002
372e18
+
372e18
+</data>
372e18
+<data2>
372e18
+HTTP/1.1 200 OK
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 4
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+
372e18
+hey
372e18
+</data2>
372e18
+
372e18
+<datacheck>
372e18
+HTTP/1.1 301 redirect
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 0
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+Location: http://firsthost.com:9999/a/path/%TESTNUMBER0002
372e18
+
372e18
+HTTP/1.1 200 OK
372e18
+Date: Tue, 09 Nov 2010 14:49:00 GMT
372e18
+Server: test-server/fake
372e18
+Content-Length: 4
372e18
+Connection: close
372e18
+Content-Type: text/html
372e18
+
372e18
+hey
372e18
+</datacheck>
372e18
+
372e18
+</reply>
372e18
+
372e18
+#
372e18
+# Client-side
372e18
+<client>
372e18
+<server>
372e18
+http
372e18
+</server>
372e18
+ <name>
372e18
+HTTP with auth redirected to HTTP on a diff port --location-trusted
372e18
+ </name>
372e18
+ <command>
372e18
+-x http://%HOSTIP:%HTTPPORT http://firsthost.com --location-trusted -u joe:secret
372e18
+</command>
372e18
+</client>
372e18
+
372e18
+#
372e18
+# Verify data after the test has been "shot"
372e18
+<verify>
372e18
+<protocol>
372e18
+GET http://firsthost.com/ HTTP/1.1
372e18
+Host: firsthost.com
372e18
+Authorization: Basic am9lOnNlY3JldA==
372e18
+User-Agent: curl/%VERSION
372e18
+Accept: */*
372e18
+Proxy-Connection: Keep-Alive
372e18
+
372e18
+GET http://firsthost.com:9999/a/path/%TESTNUMBER0002 HTTP/1.1
372e18
+Host: firsthost.com:9999
372e18
+Authorization: Basic am9lOnNlY3JldA==
372e18
+User-Agent: curl/%VERSION
372e18
+Accept: */*
372e18
+Proxy-Connection: Keep-Alive
372e18
+
372e18
+</protocol>
372e18
+</verify>
372e18
+</testcase>
372e18
-- 
372e18
2.34.1
372e18
372e18
372e18
From 443ce415aa60caaf8b1c9b0b71fff8d26263daca Mon Sep 17 00:00:00 2001
372e18
From: Daniel Stenberg <daniel@haxx.se>
372e18
Date: Mon, 25 Apr 2022 17:59:15 +0200
372e18
Subject: [PATCH 4/4] openssl: don't leak the SRP credentials in redirects
372e18
 either
372e18
372e18
Follow-up to 620ea21410030
372e18
372e18
Reported-by: Harry Sintonen
372e18
Closes #8751
372e18
372e18
Upstream-commit: 139a54ed0a172adaaf1a78d6f4fff50b2c3f9e08
372e18
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
372e18
---
372e18
 lib/http.c         | 10 +++++-----
372e18
 lib/http.h         |  6 ++++++
372e18
 lib/vtls/openssl.c |  3 ++-
372e18
 3 files changed, 13 insertions(+), 6 deletions(-)
372e18
372e18
diff --git a/lib/http.c b/lib/http.c
372e18
index 0791dcf..4433824 100644
372e18
--- a/lib/http.c
372e18
+++ b/lib/http.c
372e18
@@ -776,10 +776,10 @@ output_auth_headers(struct Curl_easy *data,
372e18
 }
372e18
 
372e18
 /*
372e18
- * allow_auth_to_host() tells if autentication, cookies or other "sensitive
372e18
- * data" can (still) be sent to this host.
372e18
+ * Curl_allow_auth_to_host() tells if authentication, cookies or other
372e18
+ * "sensitive data" can (still) be sent to this host.
372e18
  */
372e18
-static bool allow_auth_to_host(struct Curl_easy *data)
372e18
+bool Curl_allow_auth_to_host(struct Curl_easy *data)
372e18
 {
372e18
   struct connectdata *conn = data->conn;
372e18
   return (!data->state.this_is_a_follow ||
372e18
@@ -864,7 +864,7 @@ Curl_http_output_auth(struct Curl_easy *data,
372e18
 
372e18
   /* To prevent the user+password to get sent to other than the original host
372e18
      due to a location-follow */
372e18
-  if(allow_auth_to_host(data)
372e18
+  if(Curl_allow_auth_to_host(data)
372e18
      || conn->bits.netrc)
372e18
     result = output_auth_headers(data, conn, authhost, request, path, FALSE);
372e18
   else
372e18
@@ -1917,7 +1917,7 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data,
372e18
                    checkprefix("Cookie:", compare)) &&
372e18
                   /* be careful of sending this potentially sensitive header to
372e18
                      other hosts */
372e18
-                  !allow_auth_to_host(data))
372e18
+                  !Curl_allow_auth_to_host(data))
372e18
             ;
372e18
           else {
372e18
 #ifdef USE_HYPER
372e18
diff --git a/lib/http.h b/lib/http.h
372e18
index 07e963d..9000bae 100644
372e18
--- a/lib/http.h
372e18
+++ b/lib/http.h
372e18
@@ -317,4 +317,10 @@ Curl_http_output_auth(struct Curl_easy *data,
372e18
                       bool proxytunnel); /* TRUE if this is the request setting
372e18
                                             up the proxy tunnel */
372e18
 
372e18
+/*
372e18
+ * Curl_allow_auth_to_host() tells if authentication, cookies or other
372e18
+ * "sensitive data" can (still) be sent to this host.
372e18
+ */
372e18
+bool Curl_allow_auth_to_host(struct Curl_easy *data);
372e18
+
372e18
 #endif /* HEADER_CURL_HTTP_H */
372e18
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
372e18
index 1bafe96..97c5666 100644
372e18
--- a/lib/vtls/openssl.c
372e18
+++ b/lib/vtls/openssl.c
372e18
@@ -2857,7 +2857,8 @@ static CURLcode ossl_connect_step1(struct Curl_easy *data,
372e18
 #endif
372e18
 
372e18
 #ifdef USE_OPENSSL_SRP
372e18
-  if(ssl_authtype == CURL_TLSAUTH_SRP) {
372e18
+  if((ssl_authtype == CURL_TLSAUTH_SRP) &&
372e18
+     Curl_allow_auth_to_host(data)) {
372e18
     char * const ssl_username = SSL_SET_OPTION(username);
372e18
 
372e18
     infof(data, "Using TLS-SRP username: %s\n", ssl_username);
372e18
-- 
372e18
2.34.1
372e18