1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_SERVICE_NAME
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_PROXY (3)
9  - CURLOPT_PROXYTYPE (3)
10  - CURLOPT_PROXY_SERVICE_NAME (3)
11Protocol:
12  - HTTP
13  - FTP
14  - IMAP
15  - POP3
16  - SMTP
17  - LDAP
18Added-in: 7.43.0
19---
20
21# NAME
22
23CURLOPT_SERVICE_NAME - authentication service name
24
25# SYNOPSIS
26
27~~~c
28#include <curl/curl.h>
29
30CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SERVICE_NAME, char *name);
31~~~
32
33# DESCRIPTION
34
35Pass a char pointer as parameter to a string holding the *name* of the service
36for DIGEST-MD5, SPNEGO and Kerberos 5 authentication mechanisms. The default
37service names are "ftp", "HTTP", "imap", "ldap", "pop" and "smtp". This option
38allows you to change them.
39
40The application does not have to keep the string around after setting this
41option.
42
43Using this option multiple times makes the last set string override the
44previous ones. Set it to NULL to disable its use again.
45
46# DEFAULT
47
48See above
49
50# %PROTOCOLS%
51
52# EXAMPLE
53
54~~~c
55int main(void)
56{
57  CURL *curl = curl_easy_init();
58  if(curl) {
59    CURLcode ret;
60    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
61    curl_easy_setopt(curl, CURLOPT_SERVICE_NAME, "custom");
62    ret = curl_easy_perform(curl);
63  }
64}
65~~~
66
67# %AVAILABILITY%
68
69# RETURN VALUE
70
71Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
72CURLE_OUT_OF_MEMORY if there was insufficient heap space.
73