Bitcoind
啟用比特幣 SSL 錯誤
我想在 Windows 上啟用 SSL。所以我下載了一個閃亮的 openssl 二進製文件,然後使用以下命令創建 server.pem 和 server.cert:
openssl genrsa -out server.pem 2048 openssl req -new -x509 -nodes -sha1 -days 3650 -key server.pem > server.cert
然後我用 bat 啟動 bitcoin-qt:
bitcoin-qt.exe -testnet -datadir=G:\BitcoinData-Testnet -conf=bitcoin.conf -server -rpcuser=usr -rpcpassword=pwd -rpcport=18332 -rpcallowip=* -rpcssl -rpcsslcertificatechainfile=server.cert -rpcsslprivatekeyfile=server.pem -txindex -lang=en_US
然後我嘗試通過執行命令來測試 SSL:
openssl s_client -connect localhost:18332
回應是:
E:\apps\Bitcoin>openssl s_client -connect localhost:18332 Loading 'screen' into random state - done CONNECTED(000001C4) 9032:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:.\ssl\s23_lib .c:177: --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 0 bytes and written 319 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE --- E:\apps\Bitcoin>openssl genrsa -out server.pem 2048 Loading 'screen' into random state - done Generating RSA private key, 2048 bit long modulus ....................+++ ...........................................+++ unable to write 'random state' e is 65537 (0x10001)
有人可以幫助我嗎?server.pem 是否正確生成?
發現了問題,我在 testnet 中執行比特幣,而我將 server.pem 和 server.cert 放在數據目錄中,而不是在“testnet3”下。當我移動這兩個文件時,一切正常。
有關更多資訊,您可以按照以下說明操作
<https://en.bitcoin.it/wiki/Enabling_SSL_on_original_client_daemon>