Skip to content

Skip the ssl validation in linux #1

@zalza13

Description

@zalza13

Hi! this code works on linux with .net core 3.0 and openssl 1.1.1


 var handler = new HttpClientHandler
            {
                ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
                {
                    if (errors == SslPolicyErrors.None)
                        return true;
                    else
                    {
                        Console.WriteLine("MailJet sslPolicyErrors {0}", errors);
                    }

                    return true;
                }
            };

            // Create HttpClient
            //_httpClient = (httpMessageHandler != null) ? new HttpClient(httpMessageHandler) : new HttpClient();
HttpClient  _httpClient = new HttpClient(handler)

this skips the validation of the ssl certificate
Bye.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions