btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.11k stars 2.32k forks source link

[Error] Client sent an HTTP request to an HTTPS server #1947

Closed lenhatquang97 closed 1 year ago

lenhatquang97 commented 1 year ago

Situation:

However, when I run this script, there is an exception:

unable to detect btcd version: status code: 400, response: "Client sent an HTTP request to an HTTPS server.\n"

Why do I run this code failed? How can I solve this problem?

btcd.conf config

testnet=1
rpcuser=4bmeiF7E3ny8cGf8Ok6QJZy/0pk=
rpcpass=2oljjSoRFzC5Go7hCGDID6xWi+c=
rpclisten=0.0.0.0:8334

btcd version

btcd version 0.23.3-beta

chappjc commented 1 year ago

btcd is not Bitcoin Core. It's RPC server uses TLS, unlike bitcoind. You can either use the rpc.cert with the rpcclient, or run btcd with --notls but rpclisten will have to be on a loopback interface.

lenhatquang97 commented 1 year ago

Thank you very much!! I have changed to rpclisten=127.0.0.1:8334 and disable tls with --notls