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

add --insecure/-k flag to allow insecure requests #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stormsweeper
Copy link

The flags are based on the same ones in cURL. With the flag added, it will create an https agent that does not reject bad certificates.

fix #143

The flags are based on the same ones in cURL. With the flag added, it will create an https agent
that does not reject bad certificates.

fix hasura#143
@@ -83,7 +90,8 @@ const query = async function (options, successCb, errorCb) {
onConnectionSuccess: () => {
client.subscribe({
subscription: query,
variables},
variables,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from npm run eslintfix

@@ -53,6 +64,7 @@ const makeClient = options => {
method: 'POST',
headers,
body: JSON.stringify({query, variables: (variables || {})}),
agent: clientContext.httpsAgent,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property is only used by node-fetch, which is what underlies isomorph-fetch in CLI.

@stormsweeper
Copy link
Author

Before:

% gq https://hasura.local/v1/graphql -H "X-Hasura-Admin-Secret: hasura" --introspect > foo.schema
Executing query... error
Error:  { errors: [ { message: 'failed to fetch' } ] }

After:

% gq https://hasura.local/v1/graphql -H "X-Hasura-Admin-Secret: hasura" --introspect -k > foo.schema
Executing query... done

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

Successfully merging this pull request may close these issues.

Allow self-signed certificates
1 participant