Open zoedberg opened 7 years ago
The issue is happening because the server is trying to open an insecure_connection to the RPC server. I sent a pull request to fix the issue by opening a secure connection using the TLS certification file.
Even with the PR I still have this issue
@Quenos hmm, it worked for me, that's why I made the change. Do you know what's causing your issue?
@bulenttastan Not yet. I'm also having the issue when following the next step in the tutorial, interacting using the command line.
Another thing I noticed that in said next step it says channel = grpc.secure_channel('localhost:10009', creds), but in your code you're interacting with port LND_RPCHOST (10002), but both are not working for me, so that is not the issue.
As a work around.... this worked for me (suggested by Tomas on LN slack) but not a long term fix (hard coded path etc)
before running edit: models.py and auth_backends.py (from source not the PR) and replace:
channel = grpc.insecure_channel(settings.LND_RPCHOST)
with: (make sure you line the indents up right with existing code - and it occurs 3 times in all)
os.environ["GRPC_SSL_CIPHER_SUITES"] = "HIGH+ECDSA"
cert = open('/home/yourhomenamehere/.lnd/tls.cert').read()
creds = grpc.ssl_channel_credentials(cert)
channel = grpc.secure_channel('localhost:10002', creds)
(assuming you have the tls.cert in that path that is - amend to point to it)
You just need to stop the server, edit the files and run python manage.py runserver again
ALSO - add the following to the top of those two files:
import os
Maybe it's the os.environ["GRPC_SSL_CIPHER_SUITES"] = "HIGH+ECDSA" that works for us as the other lines look functionally similar???
@bulenttastan was just typing that :) Thanks for the good work!
@wintercooled Thanks this worked for me. On Debian 9 GNU/Linux
One could also do something like:
cert = open( '%s/.lnd/tls.cert' % (os.environ["LND_CERT_HOME"],)).read()
in order to make it not use a hard coded path
+1 I also get this error. After following @wintercooled 's instructions, I got a different, but seemingly related error:
Traceback (most recent call last):
File "/Users/me/Documents/opensource/ln-workspace/deskenv/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/Users/me/Documents/opensource/ln-workspace/deskenv/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/Users/me/Documents/opensource/ln-workspace/deskenv/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/me/Documents/opensource/ln-workspace/lightning-coindesk/coindesk/views.py", line 45, in verify
user = authenticate(request=request, **kwargs)
File "/Users/me/Documents/opensource/ln-workspace/deskenv/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 100, in authenticate
user = backend.authenticate(*args, **credentials)
File "/Users/me/Documents/opensource/ln-workspace/lightning-coindesk/coindesk/auth_backends.py", line 18, in authenticate
verifymessage_resp = stub.VerifyMessage(ln.VerifyMessageRequest(msg=csrf_token, signature=signature))
File "/Users/me/Documents/opensource/ln-workspace/deskenv/lib/python2.7/site-packages/grpc/_channel.py", line 507, in __call__
return _end_unary_response_blocking(state, call, False, deadline)
File "/Users/me/Documents/opensource/ln-workspace/deskenv/lib/python2.7/site-packages/grpc/_channel.py", line 455, in _end_unary_response_blocking
raise _Rendezvous(state, None, None, deadline)
_Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.UNKNOWN, failed to decode signature: illegal z-base-32 data at input byte 2)>
Anyone have any ideas?
edit: FIXED. On OSX. Originally, I tried pointing at /Users/me/Library/Application\ Support/Lnd/tls.cert
, but that didn't work (due to permissions, I figured), so I tried pointing at a different copy of tls.cert in another folder, which also didn't work.
Then, I tried /Users/me/Library/Application Support/Lnd/tls.cert
(no backslash) and it worked.
In this tutorial (http://dev.lightning.community/tutorial/03-rpc-client/index.html), the server is connected to 'Bob' node but the instruction uses 'lncli-alice' to generate log-in credentials. Shouldn't it be 'lncli-bob'?
After inserting the signature of the message it fails, telling the status code of the RPC is UNAVAILABLE. Here the traceback: