Http.fs
Http.fs copied to clipboard
Self signed
https://gist.github.com/benhysell/10c1eb546bd3401ee50f https://stackoverflow.com/questions/28406226/how-to-import-private-key-of-self-signed-certificate-using-certmgr-in-mono#31330399
Not sure if related or this will help you @haf
The way I do this at the moment is something like:
use dangerousHttpHandler =
new HttpClientHandler(
// check:
// https://github.com/dotnet/corefx/issues/24774
// https://github.com/dotnet/corefx/issues/19709
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator)
let dangerousHttpClient = new HttpClient (dangerousHttpHandler)
let createDangerousRequest (method: HttpMethod) (url: string) =
new Uri (url)
|> Request.createWithClient dangerousHttpClient method
let request =
"https://localhost" // self-signed
|> createDangerousRequest Get
There could be more functions baked into Http.Fs to make it less cumbersome but the API surface is flexible enough.