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

WSS not working #16423

Closed
amitaymolko opened this issue Mar 31, 2018 · 2 comments
Closed

WSS not working #16423

amitaymolko opened this issue Mar 31, 2018 · 2 comments

Comments

@amitaymolko
Copy link

I'm able to geth a ws server running with the following command:
geth --rpc --ws --wsaddr="0.0.0.0" --wsorigins "*"
And I'm able to properly connect to ws://IP_ADDRESS:8546
But I'm unable to connect to a secure websocket wss://IP_ADDRESS:8546

System information

Geth version: 1.8.2-stable-b8b9f7f4
OS & Version: Ubuntu

Expected behaviour

should properly connect to wss endpoint

Actual behaviour

receive (Opcode -1) when trying to connect to wss endpoint

@suspended
Copy link

You need to use a proxy like Nginx to configure the SSL certificates needed to setup WSS.

@fjl
Copy link
Contributor

fjl commented Apr 4, 2018

@suspended is right. We don't offer secure WebSocket because that would require configuration of certificates.

@fjl fjl closed this as completed Apr 4, 2018
ashishb added a commit to celo-org/celo-monorepo that referenced this issue Sep 18, 2019
I was trying to use infura-like setup with `ws` (Web sockets). Since
`ws` sends plain-text, it does not work in prouduction. We cannot use
`wss` since it is not supported natively by geth
 - ethereum/go-ethereum#16423
Even K8s only supports https. To avoid this issue, I shifted to https.
Subscriptions don't work with https, so, a crude polling mechanism to
check for transaction confirmations.

Also, in this commit, change the nonce count to include "pending"
transactions, so that, multiple transactions can be sent without waiting
for completion.
ashishb added a commit to celo-org/celo-monorepo that referenced this issue Sep 27, 2019
I was trying to use infura-like setup with `ws` (Web sockets). Since
`ws` sends plain-text, it does not work in prouduction. We cannot use
`wss` since it is not supported natively by geth
 - ethereum/go-ethereum#16423
Even K8s only supports https. To avoid this issue, I shifted to https.
Subscriptions don't work with https, so, a crude polling mechanism to
check for transaction confirmations.

Also, in this commit, change the nonce count to include "pending"
transactions, so that, multiple transactions can be sent without waiting
for completion.
ashishb added a commit to celo-org/celo-monorepo that referenced this issue Oct 1, 2019
* Remove private key from logging

* Make infura setup work with https
I was trying to use infura-like setup with `ws` (Web sockets). Since
`ws` sends plain-text, it does not work in prouduction. We cannot use
`wss` since it is not supported natively by geth
 - ethereum/go-ethereum#16423
Even K8s only supports https. To avoid this issue, I shifted to https.
Subscriptions don't work with https, so, a crude polling mechanism to
check for transaction confirmations.

Also, in this commit, change the nonce count to include "pending"
transactions, so that, multiple transactions can be sent without waiting
for completion.

* Handle nonce related to simultaneous transactions

Handle the case when too many transactions are sent close to each other.

Geth has `web3.eth.getTransactionCount(account, 'pending')` but even
that only seems to work once the transactions have made to the
transaction pool. Therefore, for transactions sent too close to each
other, which is the case for SMS verification transactions, maintain a
local nonce and ensure that new Nonce is equal or greater than local
nonce.

* Increment nonce before sending transaction

Otherwise, the next transaction might not get the right nonce.

* Fix some issues pointed by Rossy
* Remove artifical wait
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

3 participants