Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self signed #147

Open
haf opened this issue Apr 26, 2018 · 1 comment
Open

Self signed #147

haf opened this issue Apr 26, 2018 · 1 comment

Comments

@haf
Copy link
Owner

haf commented Apr 26, 2018

@seanamos
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants