Negotiate: custom service names for SPNEGO.

* Add new options, CURLOPT_PROXY_SERVICE_NAME and CURLOPT_SERVICE_NAME.
* Add new curl options, --proxy-service-name and --service-name.
This commit is contained in:
Linus Nielsen
2015-03-29 14:52:31 +02:00
committed by Daniel Stenberg
parent 54c394699d
commit 97c272e5d1
17 changed files with 185 additions and 5 deletions

View File

@@ -576,6 +576,18 @@ CURLcode Curl_init_userdefined(struct UserDefined *set)
(char *) CURL_DEFAULT_SOCKS5_GSSAPI_SERVICE);
if(result)
return result;
/* set default negotiate proxy service name */
result = setstropt(&set->str[STRING_PROXY_SERVICE_NAME],
(char *) CURL_DEFAULT_PROXY_SERVICE_NAME);
if(result)
return result;
/* set default negotiate service name */
result = setstropt(&set->str[STRING_SERVICE_NAME],
(char *) CURL_DEFAULT_SERVICE_NAME);
if(result)
return result;
#endif
/* This is our preferred CA cert bundle/path since install time */
@@ -1472,12 +1484,29 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
va_arg(param, char *));
break;
case CURLOPT_PROXY_SERVICE_NAME:
/*
* Set negotiate proxy service name
*/
result = setstropt(&data->set.str[STRING_PROXY_SERVICE_NAME],
va_arg(param, char *));
break;
case CURLOPT_SOCKS5_GSSAPI_NEC:
/*
* set flag for nec socks5 support
*/
data->set.socks5_gssapi_nec = (0 != va_arg(param, long))?TRUE:FALSE;
break;
case CURLOPT_SERVICE_NAME:
/*
* Set negotiate service identity
*/
result = setstropt(&data->set.str[STRING_SERVICE_NAME],
va_arg(param, char *));
break;
#endif
case CURLOPT_HEADERDATA: