in dotnet/azure-functions/FunctionApp/Notes.cs [97:120]
private static CosmosClient CreateClient(string endpoint, string key)
{
return new CosmosClient(endpoint, key, new CosmosClientOptions
{
SerializerOptions = new CosmosSerializationOptions
{
PropertyNamingPolicy = CosmosPropertyNamingPolicy.CamelCase
},
HttpClientFactory = () =>
{
/* *** WARNING ***
* This code is for demo purposes only. In production, you should use the default behavior,
* which relies on the operating system's certificate store to validate the certificates.
*/
HttpMessageHandler httpMessageHandler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback =
HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
};
return new HttpClient(httpMessageHandler);
},
ConnectionMode = ConnectionMode.Direct
});
}