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

ERR_INVALID_PROTOCOL when using --skipSSLValidation #928

Closed
rostero1 opened this issue Jan 26, 2019 · 6 comments
Closed

ERR_INVALID_PROTOCOL when using --skipSSLValidation #928

rostero1 opened this issue Jan 26, 2019 · 6 comments

Comments

@rostero1
Copy link

I have a self-signed cert and am trying to download the schema, but I get

› apollo service:download --skipSSLValidation --endpoint=https://localhost/graphql/
✔ Loading Apollo Project
✖ Saving schema to schema.json

→ Protocol "https:" not supported. Expected "http:"

TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"

@SpencerCarstens
Copy link

SpencerCarstens commented Jan 29, 2019

I am also getting this with the VSCode extension.

TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
    at new ClientRequest (_http_client.js:109:11)
    at request (https.js:272:10)
    at /Users/---/.vscode-insiders/extensions/apollographql.vscode-apollo-1.4.0/node_modules/node-fetch/lib/index.js:1421:15
    at new Promise (<anonymous>)
    at fetch (/Users/---/.vscode-insiders/extensions/apollographql.vscode-apollo-1.4.0/node_modules/node-fetch/lib/index.js:1390:9)
    at /Users/---/.vscode-insiders/extensions/apollographql.vscode-apollo-1.4.0/node_modules/apollo-link-http/lib/bundle.umd.js:119:17
    at new Subscription (/Users/---/.vscode-insiders/extensions/apollographql.vscode-apollo-1.4.0/node_modules/zen-observable/lib/Observable.js:183:34)
    at Observable.subscribe (/Users/---/.vscode-insiders/extensions/apollographql.vscode-apollo-1.4.0/node_modules/zen-observable/lib/Observable.js:262:14)
    at /Users/---/.vscode-insiders/extensions/apollographql.vscode-apollo-1.4.0/node_modules/apollo-link/lib/bundle.umd.js:64:24
    at new Promise (<anonymous>)

@sebastianseilund
Copy link

Same issue here. Instead of using the --skipSSLValidation/-k flag, you can set the NODE_TLS_REJECT_UNAUTHORIZED environment variable to 0:

NODE_TLS_REJECT_UNAUTHORIZED=0 apollo service:download --endpoint <url>

Tested with Node.js v10.3.0. More info and kudos to this stackoverflow answer.

@Jayphen
Copy link

Jayphen commented Jun 6, 2019

How would one set NODE_TLS_REJECT_UNAUTHORIZED for the VS Code extension? I am facing the same issue.

@marcosfede
Copy link

Any updates on this?

@trevor-scheer
Copy link
Member

Closed via #1461

@woeterman94
Copy link

How would one set NODE_TLS_REJECT_UNAUTHORIZED for the VS Code extension? I am facing the same issue.

set NODE_TLS_REJECT_UNAUTHORIZED=0
although it's not recommended.

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

No branches or pull requests

7 participants