AN_SET_BLOCKINGSection: Antinat Programmer's Manual (3)
Index Return to Main Contents
The an_set_credentials(3) function is used to set the username and password which will be used to authenticate to the proxy server. Authentication is only supported on some types of proxy server, and different schemes exist for eachi type. Some types support multiple authentication mechanisms.
Depending on the type of proxy you use, and its configuration, credentials may or may not be required. If they are, use this function to set the credentials on the socket. By default, credentials are read from the AN_USER and AN_PASS environment variables, if they are set. If not, the library will require a server that supports anonymous authentication, or connections will fail. Note also that if an_set_authscheme(3) has been called, and only an anonymous scheme has been selected, the values specified in this function will never be used.
s is a socket previously created with an_new_connection(3).
username is a pointer to a NULL-terminated character array containing the username to use. In many schemes, this is case-sensitive. This can be NULL if no username should be stored, and username-based authentication should not be supported.
- The socket handle is invalid.
- There was not enough memory to allocate and store the username or password. If this occurs, the exact username and password combination remaining are undefined.
Malcolm Smith <email@example.com>
Time: 14:19:44 GMT, January 09, 2005