Giter Club home page Giter Club logo

Comments (4)

ZyXELis avatar ZyXELis commented on May 28, 2024 1

did not work :(

Traceback (most recent call last):
File "send_sms.py", line 7, in
connection = AuthorizedConnection('http://admin:[email protected]/')
File "/usr/lib/python3/dist-packages/huawei_lte_api/AuthorizedConnection.py", line 21, in init
super().init(clear_url, timeout=timeout)
File "/usr/lib/python3/dist-packages/huawei_lte_api/Connection.py", line 40, in init
self.session = requests.Session(verify=False)
TypeError: init() got an unexpected keyword argument 'verify'

BUT, I found this:
psf/requests#1034 (comment)
which states:

Session no longer takes arguments in its constructor. Currently the documentation is out of date on this.

So after adding a verify line right after requests line:

self.session = requests.Session()
self.session.verify = False

Everything worked again ;) thanks for the pointer. Hope it will be moved to the script itself so it will not vanish after upgrades or container reinstall.

from huawei-lte-api.

Salamek avatar Salamek commented on May 28, 2024

@ZyXELis hi...
well ~correct way how to fix this is make your OS to trust that certificate... somehow... but quick and dirty fix is to modify this line in /usr/lib/python3/dist-packages/huawei_lte_api/Connection.py :

self.session = requests.Session()

and change it to:

self.session = requests.Session(verify=False) 

That disables SSL verification and should get you going... i may expose this parameter to the Connection constructor so you can do it from your code...

from huawei-lte-api.

wax911 avatar wax911 commented on May 28, 2024

Out of curiosity, would it not be somewhat easier/better in the long run (readability and maintenance wise) to allow sessions to be a constructor with a default argument for Connection? I get that d49445b Added kwargs for applying props to session which is also good

from huawei-lte-api.

dartoi avatar dartoi commented on May 28, 2024

Hi, how to restore SSL certificate?

from huawei-lte-api.

Related Issues (20)

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.