summaryrefslogtreecommitdiffstats
path: root/usr.bin/nc
diff options
context:
space:
mode:
authorbenno <benno@openbsd.org>2019-07-29 15:19:03 +0000
committerbenno <benno@openbsd.org>2019-07-29 15:19:03 +0000
commitdd094f59c5ad2baa23b2f5d8ccc0641aafed2dee (patch)
tree8697dadd70fde6b3a62445e1a365edec14d0ce73 /usr.bin/nc
parentSupport disk write in efiboot. Requested by deraadt. (diff)
downloadwireguard-openbsd-dd094f59c5ad2baa23b2f5d8ccc0641aafed2dee.tar.xz
wireguard-openbsd-dd094f59c5ad2baa23b2f5d8ccc0641aafed2dee.zip
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");