Setting Proxy Information
Using the Toolkit

prevnext

Setting Proxy Information

An application can set information about the HTTP proxy using the Vtk_ProxyInfo structure. This structure is used to specify the proxy host and port number used in the OCSP, CRT, and HTTP-CRL protocols. It is not used for LDAP-CRL.

This structure is used only if the option CO_HTTPProxy is specified as the value for the Vtk_CtxtOptionType enumeration which defines configuration option types for a Vtk_Ctxt structure. Configuration options can be configured using the Vtk_CtxtSetOption function and can be retrieved using the Vtk_CtxtGetOption function.

Code Sample for Setting Proxy Information

/*
* setProxyInfo
*
* Function to set the HTTP Proxy information to use by the ValiCert
* Validator Toolkit.
*
* Parameters:
* ctxt - a valid ValiCert Toolkit context previously created
* with Vtk_CtxtNew function call
* proxyHost - host machine for the proxy (e.g. "merced")
* proxyPort - port for the proxy
*/
int setProxyInfo(Vtk_Ctxt *ctxt, char *proxyHost, int proxyPort)
{
Vtk_ProxyInfo proxyInfo;
Vtk_CtxtOption ctxtOption;
Vtk_uint32 ret;

/*
* set the proxy info structure with supplied data
*/
proxyInfo.host = proxyHost;
proxyInfo.port = proxyPort;

/*
* set the ctxt option structure for use with proxy info
*/
ctxtOption.option = CO_HTTPProxy;
ctxtOption.d.aProxyInfo = &proxyInfo;

/*
* set the ctxt option
*/
ret = Vtk_CtxtSetOption(ctxt, &ctxtOption); assert(ret == VTK_OK);
return 0;
} /* setProxyInfo */

prevnext


ValiCert, Inc.
http://www.valicert.com
Voice: +1.650.567.5469
Fax: (+1.650.254.2148
support@valicert.com