From 8aa29ced0a2622bb054d331a201313abcd7d7931 Mon Sep 17 00:00:00 2001 From: benno <> Date: Mon, 29 Jul 2019 15:19:03 +0000 Subject: Make proxy auth work with http 1.1 speaking webservers. Diff from Alexander Koeppe format_c -AT- online -DOT- de, thanks. ok deraadt@ --- src/usr.bin/nc/socks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/usr.bin/nc/socks.c b/src/usr.bin/nc/socks.c index 39e4331be3..5ec5c95cd6 100644 --- a/src/usr.bin/nc/socks.c +++ b/src/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"); -- cgit v1.2.3-55-g6feb