robclark56 / RaspiBolt-Extras

More Ways to Use The RaspiBolt
MIT License
21 stars 8 forks source link

Auto Wallet Unlock - "authentication handshake failed" #8

Open grnqrtr opened 5 years ago

grnqrtr commented 5 years ago

Thanks robclark56 for your tutorials. I've been having fun playing with lightning!

I am trying to set up the "Auto Wallet Unlock using Encyrypted Wallet Password."

If I test the PHP file my encrypted password is successfully returned from the webserver, but when I try to run /etc/cron.hourly/lnd_unlock;echo it does not unlock my wallet and returns this error:

{"error":"connection error: desc = \"transport: authentication handshake failed: x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs\"","code":13}

The only thing I changed from your example /etc/cron.hourly/lnd_unlock was the path to admin.macaroon because that seems to be different. I'm using lnd version 0.5.0-beta commit=3b2c807288b1b7f40d609533c1e96a510ac5fa6d

Do you have any idea what I could do to fix this error? Maybe I need to make my certificates differently?

robclark56 commented 5 years ago

I am guessing here ... (I have not upgraded to V0,5.x) ... but I think that error is because of 1 of these

  1. You have missed the "--insecure" flag in the curl statement
  2. The last line of the curl command is: https://127.0.0.1:${restlisten}/v1/unlockwallet instead of https://localhost:${restlisten}/v1/unlockwallet
  3. You need to rebuild your certs after the change to lnd.conf (That usually means deleting the macaroons and restarting LND)
  4. ???
grnqrtr commented 5 years ago

Thanks for the suggestions. It's not 1 or 2, I have the curl command as you do in the example. I was in the process of trying 3, but after moving the macaroons the wallet just complains about not being able to locate them. I thought it would create new ones, but maybe not? I moved the original macaroons back and after closing out my open channels and moving my bitcoin out I will make a new wallet and try again.