IBackgroundCopyJobHttpOptions::GetSecurityFlags method (bits2_5.h)

Retrieves the flags for HTTP that determine whether the certificate revocation list is checked and certain certificate errors are ignored, and the policy to use when a server redirects the HTTP request.

Syntax

HRESULT GetSecurityFlags(
  [out] ULONG *pFlags
);

Parameters

[out] pFlags

HTTP security flags that indicate which errors to ignore when connecting to the server. One or more of the following flags can be set:

Value Meaning
BG_SSL_ENABLE_CRL_CHECK
0x0001
Check the certificate revocation list (CRL) to verify that the server certificate has not been revoked.
BG_SSL_IGNORE_CERT_CN_INVALID
0x0002
Ignores errors caused when the certificate host name of the server does not match the host name in the request.
BG_SSL_IGNORE_CERT_DATE_INVALID
0x0004
Ignores errors caused by an expired certificate.
BG_SSL_IGNORE_UNKNOWN_CA
0x0008
Ignore errors associated with an unknown certification authority (CA).
BG_SSL_IGNORE_CERT_WRONG_USAGE
0x0010
Ignore errors associated with the use of a certificate.
BG_HTTP_REDIRECT_POLICY_ALLOW_SILENT
0x0000
Allows the server to redirect your request to another server. This is the default.
BG_HTTP_REDIRECT_POLICY_ALLOW_REPORT
0x0100
Allows the server to redirect your request to another server. BITS updates the remote name with the final URL.
BG_HTTP_REDIRECT_POLICY_DISALLOW
0x0200
Places the job in the fatal error state when the server redirects your request to another server. BITS updates the remote name with the redirected URL.
BG_HTTP_REDIRECT_POLICY_MASK
0x0700
Bitmask that you can use with the security flag value to determine which redirect policy is in effect. It does not include the flag ALLOW_HTTPS_TO_HTTP.

The following example shows how to use this mask to test for the BG_HTTP_REDIRECT_POLICY_DISALLOW redirection policy.

if (BG_HTTP_REDIRECT_POLICY_DISALLOW == (flags & BG_HTTP_REDIRECT_POLICY_MASK))

BG_HTTP_REDIRECT_POLICY_ALLOW_HTTPS_TO_HTTP
0x0800
Allows the server to redirect an HTTPS request to an HTTP URL.

You can combine this flag with BG_HTTP_REDIRECT_POLICY_ALLOW_SILENT and BG_HTTP_REDIRECT_POLICY_ALLOW_REPORT.

Return value

Returns S_OK when successful.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header bits2_5.h (include Bits.h)
Library Bits.lib

See also

IBackgroundCopyJobHttpOptions

IBackgroundCopyJobHttpOptions::SetSecurityFlags