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

EOS networks don't support HTTPS endpoints #65

Closed
k26dr opened this issue May 29, 2018 · 6 comments
Closed

EOS networks don't support HTTPS endpoints #65

k26dr opened this issue May 29, 2018 · 6 comments

Comments

@k26dr
Copy link

k26dr commented May 29, 2018

Eosjs requests routed through Scatter do not support HTTPS. The httpEndpoint config option is automatically prefixed with http://

https://github.com/EOSEssentials/Scatter/blob/27316e762fb03ef35267daa07a0ac08f40aa443b/src/plugins/defaults/eos.js#L44

Using an HTTPS endpoint would require supporting a protocol option for networks so it could be used like:

var network = {
    blockchain: 'eos',
    protocol: "https",
    host: "bp.libertyblock.io",
    port: 8890,
    chainId: "a628a5a6123d6ed60242560f23354c557f4a02826e223bb38aad79ddeb9afbca"
}
@yepp4you
Copy link

I have already registered below.
https://github.com/EOSEssentials/Scatter/issues/51

@mlockett42
Copy link

I am not able to connect to the liberty block bp while using eos-js. Maybe https just doesn't work yet? I am able to connect with curl however so I am not sure what the difference is

var options = {
  httpEndpoint: 'https://bp.libertyblock.io:8890',
  debug: false,
  fetchConfiguration: {},
}

eos = Eos.Localnet(options) // testnet at eos.io

eos.getInfo({}).then(
.....

Gives

api error =>  https://bp.libertyblock.io:8890/v1/chain/get_info {}
{ FetchError: request to https://bp.libertyblock.io:8890/v1/chain/get_info failed, reason: socket hang up
    at ClientRequest.<anonymous> (/opt/project/eos-voter/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:387:9)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  name: 'FetchError',
  message: 'request to https://bp.libertyblock.io:8890/v1/chain/get_info failed, reason: socket hang up',
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET' }
{ FetchError: request to https://bp.libertyblock.io:8890/v1/chain/get_info failed, reason: socket hang up
    at ClientRequest.<anonymous> (/opt/project/eos-voter/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:387:9)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  name: 'FetchError',
  message: 'request to https://bp.libertyblock.io:8890/v1/chain/get_info failed, reason: socket hang up',
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET' }
Error result= { FetchError: request to https://bp.libertyblock.io:8890/v1/chain/get_info failed, reason: socket hang up
    at ClientRequest.<anonymous> (/opt/project/eos-voter/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:387:9)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  name: 'FetchError',
  message: 'request to https://bp.libertyblock.io:8890/v1/chain/get_info failed, reason: socket hang up',
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET' }

@k26dr k26dr closed this as completed May 31, 2018
@k26dr
Copy link
Author

k26dr commented May 31, 2018

Duplicate issue. Closing

@k26dr
Copy link
Author

k26dr commented May 31, 2018

image

Server is working fine.

@k26dr
Copy link
Author

k26dr commented May 31, 2018

https://github.com/LibertyBlock/eos-voting/blob/master/main.js#L51

That's an example of how to connect. Replace URL with your desired one. HTTPS is supported by eosjs. I have used it before.

@nsjames
Copy link
Contributor

nsjames commented Jun 1, 2018

aabec88

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

4 participants