aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-09-21 11:05:31 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-09-21 11:05:31 +0000
commit015d5869d7e3daf81548e4d5d55209adfd4285bf (patch)
tree68ac2015ec29991b3c56ffdb51ecc977c2408437 /lib/http.c
parent4686adb4331b539dacd065bafc82e31a9eca08e8 (diff)
Mark Davies fixed Negotiate authentication over proxy, and also introduced
the --proxy-negotiate command line option to allow a user to explicitly select it.
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index 090aad3d2..67b2d3f55 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -424,6 +424,18 @@ Curl_http_output_auth(struct connectdata *conn,
/* Send proxy authentication header if needed */
if (conn->bits.httpproxy &&
(conn->bits.tunnel_proxy == proxytunnel)) {
+#ifdef HAVE_GSSAPI
+ if((authproxy->picked == CURLAUTH_GSSNEGOTIATE) &&
+ data->state.negotiate.context &&
+ !GSS_ERROR(data->state.negotiate.status)) {
+ auth="GSS-Negotiate";
+ result = Curl_output_negotiate(conn, TRUE);
+ if (result)
+ return result;
+ authproxy->done = TRUE;
+ }
+ else
+#endif
#ifdef USE_NTLM
if(authproxy->picked == CURLAUTH_NTLM) {
auth="NTLM";
@@ -486,7 +498,7 @@ Curl_http_output_auth(struct connectdata *conn,
data->state.negotiate.context &&
!GSS_ERROR(data->state.negotiate.status)) {
auth="GSS-Negotiate";
- result = Curl_output_negotiate(conn);
+ result = Curl_output_negotiate(conn, FALSE);
if (result)
return result;
authhost->done = TRUE;
@@ -593,7 +605,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
authp->avail |= CURLAUTH_GSSNEGOTIATE;
if(authp->picked == CURLAUTH_GSSNEGOTIATE) {
/* if exactly this is wanted, go */
- int neg = Curl_input_negotiate(conn, start);
+ int neg = Curl_input_negotiate(conn, (bool)(httpcode == 407), start);
if (neg == 0) {
data->reqdata.newurl = strdup(data->change.url);
data->state.authproblem = (data->reqdata.newurl == NULL);