You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
httpClient silently falls back to insecure http transport for https uri's that do not specify the port.
port is parsed with parseInt allowing a negative port to be passed. Check bounds or use parseSaturatedNatural instead. This may fail in nim-chronos though (which still allows port 0)
implement ssl/tls support (I assume that's part of the reason for this issue) (nim-chronos/transports/common does not implement tls either) or reject https URLs and make users aware that their RPC is established over an insecure transport.
Note: Under normal circumstances, the RPC endpoint is probably system local anyway, however, one might choose to connect to an RPC endpoint on a different host/net inter or intra datacenter.
make users aware of the fact that their connection is established with an insecure endpoint if URL.scheme is https. reject to connect to https if it is not implemented.
The text was updated successfully, but these errors were encountered:
Description
httpClient
silently falls back to insecurehttp
transport forhttps
uri's that do not specify the port.parseInt
allowing a negative port to be passed. Check bounds or use parseSaturatedNatural instead. This may fail innim-chronos
though (which still allows port 0)nim-chronos/transports/common
does not implement tls either) or rejecthttps
URLs and make users aware that their RPC is established over an insecure transport.Note: Under normal circumstances, the RPC endpoint is probably system local anyway, however, one might choose to connect to an RPC endpoint on a different host/net inter or intra datacenter.
How to reproduce
expected: transport security enabled for
https
URL: https://mainnet.infura.ioactual result: no transport security as client silently falls back to http://mainnet.infura.io:80
see: logline
file=httpclient.nim:47 address=34.227.246.217:80
Details
nim-json-rpc/json_rpc/clients/httpclient.nim
Lines 207 to 213 in f53e0b9
Recommendation
https
(with any port specified; don't fall back tohttp
if port 80)https
set port to default 443parseInt
https
. reject to connect tohttps
if it is not implemented.The text was updated successfully, but these errors were encountered: