ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.03k stars 723 forks source link

Allow StrawberryShake.Tools to bypass SSL validation #7014

Closed jimitndiaye closed 2 months ago

jimitndiaye commented 2 months ago

Product

Strawberry Shake

Is your feature request related to a problem?

During dev I have to work with a graphql server on a server whose certificate is invalid. When I attempt to download the GraphQL schema I get the following:

 dotnet graphql download https://domain.certificate.mismatch/graphql
Download schema started.
error HTTP_ERROR: The SSL connection could not be established, see inner exception.

The solution you'd like

It would be great if the tool added a flag named something like --disable-ssl-validation that would allow running requests against such a server to at least allow code generation and schema downloads to work. You could use an HttpClientHandler set up as follows:

var hander = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
jimitndiaye commented 2 months ago

An alternative solution would be a parameter that allowed passing in a downloaded schema file e.g --schema .\schema.graphql

jimitndiaye commented 2 months ago

found the -f parameter that allows passing in a file path for the schema