Skip to content

Commit

Permalink
feat(CosmosStore)!: Remove bypassCertificateValidation option
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Jan 19, 2024
1 parent 43c6ae9 commit 89a5ccb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ The `Unreleased` section name is replaced by the expected version of next releas
### Removed

- `Equinox.ISyncContext.CreateMemento` [#413](https://github.com/jet/equinox/pull/413)
- Stores: `*StoreCategory.FromMemento` [#413](https://github.com/jet/equinox/pull/413)
- Stores: Removed `Equinox.Core` dependency; everything a store needs is either inlined privately, or lives in `Equinox` [#420](https://github.com/jet/equinox/pull/420)
- Remove explicit `net461` handling; minimum target now `net6.0` / `FSharp.Core` v `6.0.0` [#310](https://github.com/jet/equinox/pull/310) [#323](https://github.com/jet/equinox/pull/323) [#354](https://github.com/jet/equinox/pull/354)
- Remove `Equinox.Core.ICache` (there is/was only one impl, and the interface has changed as part of [#386](https://github.com/jet/equinox/pull/386)) [#389](https://github.com/jet/equinox/pull/389)
- `CosmosStore.CosmosStoreConnector`: Removed `bypassCertificateValidation` [#170](https://github.com/jet/equinox/pull/170)

### Fixed

Expand Down
7 changes: 0 additions & 7 deletions src/Equinox.CosmosStore/CosmosStore.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,19 +1194,12 @@ type CosmosStoreConnector
[<O; D null>] ?mode: ConnectionMode,
// consistency mode (default: use configuration specified for Database)
[<O; D null>] ?defaultConsistencyLevel: ConsistencyLevel,
// Inhibits certificate verification when set to `true`. Default: false.
[<O; D null>] ?bypassCertificateValidation: bool,
[<O; D null>] ?customize: Action<CosmosClientOptions>) =
let discoveryMode = discovery.ToDiscoveryMode()
let factory =
let o = CosmosClientFactory.CreateDefaultOptions(requestTimeout, maxRetryAttemptsOnRateLimitedRequests, maxRetryWaitTimeOnRateLimitedRequests)
mode |> Option.iter (fun x -> o.ConnectionMode <- x)
defaultConsistencyLevel |> Option.iter (fun x -> o.ConsistencyLevel <- x)
// https://github.com/Azure/azure-cosmos-dotnet-v3/blob/1ef6e399f114a0fd580272d4cdca86b9f8732cf3/Microsoft.Azure.Cosmos.Samples/Usage/HttpClientFactory/Program.cs#L96
if defaultArg bypassCertificateValidation false then
let cb = System.Net.Http.HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
let ch = new System.Net.Http.HttpClientHandler(ServerCertificateCustomValidationCallback = cb)
o.HttpClientFactory <- fun () -> new System.Net.Http.HttpClient(ch)
customize |> Option.iter (fun c -> c.Invoke o)
CosmosClientFactory o

Expand Down

0 comments on commit 89a5ccb

Please sign in to comment.