Giter Club home page Giter Club logo

Comments (10)

wintercooled avatar wintercooled commented on July 24, 2024 6

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???

from lightning-coindesk.

samjhill avatar samjhill commented on July 24, 2024 1

+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.

from lightning-coindesk.

bulenttastan avatar bulenttastan commented on July 24, 2024

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.

from lightning-coindesk.

Quenos avatar Quenos commented on July 24, 2024

Even with the PR I still have this issue

from lightning-coindesk.

bulenttastan avatar bulenttastan commented on July 24, 2024

@Quenos hmm, it worked for me, that's why I made the change. Do you know what's causing your issue?

from lightning-coindesk.

Quenos avatar Quenos commented on July 24, 2024

@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.

from lightning-coindesk.

Quenos avatar Quenos commented on July 24, 2024

@bulenttastan was just typing that :)
Thanks for the good work!

from lightning-coindesk.

adlererik avatar adlererik commented on July 24, 2024

@wintercooled Thanks this worked for me. On Debian 9 GNU/Linux

from lightning-coindesk.

doctorzhivago avatar doctorzhivago commented on July 24, 2024

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

from lightning-coindesk.

jinsu35 avatar jinsu35 commented on July 24, 2024

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'?

from lightning-coindesk.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.