JetBrains / YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
https://www.jetbrains.com/youtrack
Apache License 2.0
134 stars 105 forks source link

Support setting properties on HttpClientHandler #77

Closed maartenba closed 6 years ago

maartenba commented 6 years ago

Support setting properties on HttpClientHandler in both BearerTokenConnection and UsernamePasswordConnection. Scenarios could be configuring SSL etc.

An example could be setting the HttpClientHandler's ServerCertificateCustomValidationCallback:

var connection = new BearerTokenConnection(
    "https://ytsharp.myjetbrains.com/youtrack/", 
    "perm:abcdefghijklmn", 
    handler =>
    {
        handler.ServerCertificateCustomValidationCallback =
            (sender, certificate, chain, sslPolicyErrors) => true;
    });

(Note the above is not a secure example as it disables SSL certificate checks!)