summaryrefslogtreecommitdiff
path: root/usr.bin/nc
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2019-07-29 15:19:04 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2019-07-29 15:19:04 +0000
commit33eb6c87ca477c4a20d614ecc71058aee608d1a9 (patch)
tree17cabdd056571f3ba13447eaec2d8deeb3161288 /usr.bin/nc
parented9d483a217ef7776bcb12fb7aa535339af9a4a8 (diff)
Make proxy auth work with http 1.1 speaking webservers.
Diff from Alexander Koeppe format_c -AT- online -DOT- de, thanks. ok deraadt@
Diffstat (limited to 'usr.bin/nc')
-rw-r--r--usr.bin/nc/socks.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/nc/socks.c b/usr.bin/nc/socks.c
index 39e4331be39..5ec5c95cd61 100644
--- a/usr.bin/nc/socks.c
+++ b/usr.bin/nc/socks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: socks.c,v 1.28 2019/07/03 03:24:02 deraadt Exp $ */
+/* $OpenBSD: socks.c,v 1.29 2019/07/29 15:19:03 benno Exp $ */
/*
* Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
@@ -373,7 +373,8 @@ socks_connect(const char *host, const char *port,
/* Read status reply */
proxy_read_line(proxyfd, buf, sizeof(buf));
if (proxyuser != NULL &&
- strncmp(buf, "HTTP/1.0 407 ", 12) == 0) {
+ (strncmp(buf, "HTTP/1.0 407 ", 12) == 0 ||
+ strncmp(buf, "HTTP/1.1 407 ", 12) == 0)) {
if (authretry > 1) {
fprintf(stderr, "Proxy authentication "
"failed\n");