Open mprakhov17 opened 5 months ago
Which version of rust-bitcoincore-rpc are you using?
This header was added to rust-jsonrpc in http://github.com/apoelstra/rust-jsonrpc/pull/85 which appeared in jsonrpc 0.14.1 used by this library.
Or is this a new issue introduced by our switch to minreq (but which has not been released yet)?
@apoelstra
The issue is observed on bitcoincore-rpc = "0.14.0"
Today I clone bitcoincore-rpc repo (version = "0.19.0") - the same problem
Are there any ad-hoc solutions? It is blocking our development now 😢
0.17 or 0.18 will definitely work because they have a fix for this particular issue.
0.19 possibly reintroduced it when we switched the underlying HTTP transport to minreq.
it seems the problem is that rust-jsonrpc convert domain name to IP address and as a result we got request like: curl -X POST --user user:pass \ http://11.11.11.11 \ -H 'Content-Type: application/json' -H 'Host: 11.11.11.11' \ -d '{"method":"getblockchaininfo","params":[],"id":1,"jsonrpc":"2.0"}'
Which will be blocked by cloudflare with a 1003 error because host contains IP too instead domain name
Is this on 0.19 or pre-0.19? The rust-jsonrpc simple_http
backend uses whatever hostname you provide when constructing the client, and will not do any DNS lookups. The minreq
backend is not really in our control. Possibly this is a bug for them. Or possibly a bug for cloudflare.
0.17, 0.18, 0.19 I think it is jsonrpc bug... will create a ticket there
@mprakhov17 Any progress on this?
@spartucus can you give more context on what need to done on this issue, am available to work on it and submit a PR
I'm using
test_against_node.rs
example When I set up my URL (as an examplehttp://bitcoin.test.node
), DNS name during request converted to11.11.11.11
and I', getting 400 response due to Host header is not added (Cloudflare 1003 error)Is it possible to automatically include the Host header or do it manually?