Fix wss connect

pull/6501/head
Qwerty5Uiop 2 years ago
parent 170c3f7095
commit e9e25b6995
  1. 1
      CHANGELOG.md
  2. 7
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket/web_socket_client.ex

@ -19,6 +19,7 @@
- [#6889](https://github.com/blockscout/blockscout/pull/6889) - Fix Internal Server Error on tx input decoding
- [#6893](https://github.com/blockscout/blockscout/pull/6893) - Fix token type definition for multiple interface tokens
- [#6922](https://github.com/blockscout/blockscout/pull/6922) - Fix WebSocketClient
- [#6501](https://github.com/blockscout/blockscout/pull/6501) - Fix wss connect
### Chore

@ -62,6 +62,8 @@ defmodule EthereumJSONRPC.WebSocket.WebSocketClient do
%URI{host: host} = URI.parse(url)
host_charlist = String.to_charlist(host)
:ssl.start()
# `:depth`, `:verify`, and `:verify_fun`, are based on `:hackney_connect.ssl_opts_1/2` as we use `:hackney` through
# `:httpoison` and this keeps the SSL rules consistent between HTTP and WebSocket
:websocket_client.start_link(
@ -76,7 +78,10 @@ defmodule EthereumJSONRPC.WebSocket.WebSocketClient do
depth: 99,
# SNI extension discloses host name in the clear, but allows for compatibility with Virtual Hosting for TLS
server_name_indication: host_charlist,
verify_fun: {&:ssl_verify_hostname.verify_fun/3, [check_hostname: host_charlist]}
verify_fun: {&:ssl_verify_hostname.verify_fun/3, [check_hostname: host_charlist]},
customize_hostname_check: [
match_fun: :public_key.pkix_verify_hostname_match_fun(:https)
]
]
)
end

Loading…
Cancel
Save