tailcallhq / tailcall

High Performance GraphQL Runtime
https://tailcall.run
Apache License 2.0
1.26k stars 238 forks source link

feat: accept self-signed certificates for development #2801

Open asimpleidea opened 1 week ago

asimpleidea commented 1 week ago

Is your feature request related to a problem? Please describe. If you have REST APIs hosted somewhere with a self-signed certificate (for example while developing), tailcall will return an error like this:

{
    "data": null,
    "errors": [
        {
            "message": "IOException: Request error: error sending request for url (https://example.com/api/v1/service): error trying to connect: invalid peer certificate: Other(CaUsedAsEndEntity)",
            "locations": [
                {
                    "line": 2,
                    "column": 5
                }
            ]
        }
    ]
}

Describe the solution you'd like Some alternatives:

Describe alternatives you've considered None.

Additional context Still too new to tailcall so I am not very familiar with its code, but should involve using .danger_accept_invalid_certs(true) if using reqwest.

tusharmath commented 1 week ago

I like the upstream setting approach. We could call it - verifySSL setting it to true by default.

tusharmath commented 1 week ago

Would you be interested in adding this change?

asimpleidea commented 1 week ago

Would you be interested in adding this change?

Sure, I have already implemented this.

I will polish the code (and also call the setting as you suggested) and will create a PR ASAP :)