HttpUpdateServiceConfiguration function

Updates atomically a service configuration parameter that specifies a Transport Layer Security (TLS) certificate in a configuration record within the HTTP Server API configuration store.

Syntax


ULONG WINAPI HttpUpdateServiceConfiguration(
  _Reserved_ HANDLE                 Handle,
  _In_       HTTP_SERVICE_CONFIG_ID ConfigId,
  _In_       PVOID                  ConfigInfo,
  _In_       ULONG                  ConfigInfoLength,
  _Reserved_ LPOVERLAPPED           Overlapped
);

Parameters

Handle [in]

Reserved and must be NULL.

ConfigId [in]

The type of configuration record to update. This parameter can be one of the following values from the HTTP_SERVICE_CONFIG_ID enumeration.

ConfigId valueMeaning
HttpServiceConfigSSLCertInfo

Updates a specified SSL certificate record.

HttpServiceConfigSslSniCertInfo

Updates a specified SSL Server Name Indication (SNI) certificate record.

HttpServiceConfigSslCcsCertInfo

Updates the SSL certificate record that specifies that Http.sys should consult the Centralized Certificate Store (CCS) store to find certificates if the port receives a TLS handshake. The port is specified by the KeyDesc member of the HTTP_SERVICE_CONFIG_SSL_CCS_SET structure that you pass to the pConfigInfo parameter.

 

ConfigInfo [in]

A pointer to a buffer that contains the appropriate data to specify the type of record to update. The following table shows the type of data the buffer contains for the different possible values of the ConfigId parameter.

ConfigId valueType of data in the pConfigInfo buffer
HttpServiceConfigSSLCertInfo

HTTP_SERVICE_CONFIG_SSL_SET structure.

HttpServiceConfigSslSniCertInfo

HTTP_SERVICE_CONFIG_SSL_SNI_SET structure. The hostname will be "*" when the SSL central certificate store is queried and wildcard bindings are used, and a host name for regular SNI.

HttpServiceConfigSslCcsCertInfo

HTTP_SERVICE_CONFIG_SSL_CCS_SET structure. This structure is used to add the CCS store on the specified port, as well as to delete, retrieve, or update an existing SSL CCS record.

 

ConfigInfoLength [in]

The size, in bytes, of the ConfigInfo buffer.

Overlapped [in]

Reserved and must be NULL.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the following error codes.

ValueMeaning
ERROR_FILE_NOT_FOUND

The specified record does not exist.

ERROR_INSUFFICIENT_BUFFER

The buffer size specified in the ConfigInfoLength parameter is insufficient.

ERROR_INVALID_HANDLE

The ServiceHandle parameter is invalid.

ERROR_INVALID_PARAMETER

One or more of the supplied parameters is in an unusable form.

ERROR_NO_SUCH_LOGON_SESSION

The SSL Certificate used is invalid. This can occur only if the HttpServiceConfigSSLCertInfo parameter is used.

Other

A system error code defined in WinError.h.

 

Remarks

The configuration parameters that you update with HttpUpdateServiceConfiguration are applied to all the HTTP Server API applications on the machine, and persist when the HTTP Server API shuts down, or when the computer is restarted.

Requirements

Minimum supported client

Windows 10, version 1703 [desktop apps only]

Minimum supported server

None supported

Header

Http.h

Library

Httpapi.lib

DLL

Httpapi.dll

See also

HTTP Server API Version 1.0 Functions
HttpSetServiceConfiguration
HttpQueryServiceConfiguration
HttpDeleteServiceConfiguration
HTTP_SERVICE_CONFIG_ID
HTTP_SERVICE_CONFIG_SSL_SET
HTTP_SERVICE_CONFIG_SSL_SNI_SET
HTTP_SERVICE_CONFIG_SSL_CCS_SET

 

 

Show: