> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XNetworkingVerifyServerCertificate

> XNetworkingVerifyServerCertificate

# XNetworkingVerifyServerCertificate

Provides additional certificate chain validation.

## Syntax

```cpp theme={null}
HRESULT XNetworkingVerifyServerCertificate(
         void* requestHandle,
         const XNetworkingSecurityInformation* securityInformation
)
```

### Parameters

*requestHandle*   \_In\_\
Type: void\*

A handle of type [HINTERNET](https://learn.microsoft.com/windows/win32/winhttp/hinternet-handles-in-winhttp). To obtain a valid handle, call [WinHttpOpenRequest](https://learn.microsoft.com/windows/win32/api/winhttp/nf-winhttp-winhttpopenrequest).

*securityInformation*   \_In\_\
Type: [XNetworkingSecurityInformation](/reference/networking/xnetworking/structs/xnetworkingsecurityinformation)\*

Pointer to an `XNetworkingSecurityInformation` structure. To get an appropriate pointer, call the[XNetworkingQuerySecurityInformationForUrlAsyncResult](/reference/networking/xnetworking/functions/xnetworkingquerysecurityinformationforurlasyncresult) function.

### Return value

Type: HRESULT

Returns `S_OK` if successful. This indicates that the server certificate chain is valid. Otherwise, it returns an error code indicating the server chain could not be validated. Treat all failures as fatal to the HTTP request.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

Call this function from within the `WINHTTP_CALLBACK_STATUS_SENDING_REQUEST` WinHTTP callback. Pass a cached `XNetworkingSecurityInformation` structure from a previous call to [XNetworkingQuerySecurityInformationForUrlAsync](/reference/networking/xnetworking/functions/xnetworkingquerysecurityinformationforurlasync) along with the WinHTTP request handle associated with the callback. For additional information about the callback, see [WinHttpSendRequest](https://learn.microsoft.com/windows/win32/api/winhttp/nf-winhttp-winhttpsendrequest).

If the `XNetworkingVerifyServerCertificate` function fails, the gaming runtime has likely detected a compromised connection to the server. In this case, you should immediately close the WinHTTP request handle before the callback returns to ensure that no data is transferred to or from the compromised server.

As a best practice, all title communication, regardless of content or protocol, should be secured. A title should provide confidentiality, integrity, and authentication for all title communication. For more information, see [Communication Security Overview (NDA topic)](/build/game-principles/security/communication-security-overview)

## Requirements

**Header:** XNetworking.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [WinHTTP overview](/build/console-features/networking/web-requests/intro-winhttp)
* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[HTTP and WebSockets](/build/console-features/networking/web-requests/http-networking)\
[XNetworking](/reference/networking/xnetworking/xnetworking_members)


## Related topics

- [WinHTTP overview](/build/console-features/networking/web-requests/intro-winhttp.md)
- [XNetworking](/reference/networking/xnetworking/xnetworking_members.md)
- [certificate_deleted](/services/playfab/api-references/events/MultiplayerServers/certificate-deleted.md)
- [certificate_uploaded](/services/playfab/api-references/events/MultiplayerServers/certificate-uploaded.md)
- [MsQuic](/build/console-features/networking/game-mesh/msquic-intro-networking.md)
