Git Product home page Git Product logo

Comments (4)

rosenberg12 avatar rosenberg12 commented on September 7, 2024

I changed inside the requestor.py the verify. So I set verify=True to verify=False .
But that deliveries me ValueError: Cannot set verify_mode to CERT_NONE when check_hostname is enabled.

I also tried to disable check_hostname with

import ssl
import urllib.request

ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

from easypost-python.

Justintime50 avatar Justintime50 commented on September 7, 2024

There is not currently an option to disable SSL verification as this could lead to man-in-the-middle attacks and is not something we will support. If you absolutely need this, you could of course disable it by setting verify=False in the code and building from source like you have.

It sounds like you have a local invalid or self-signed certificate on the computer you are running your code from, is that correct? If so, the best fix is to actually fix the certificate issue (outside the scope of the support we can provide here). I also noticed you are running Anaconda, how did you install our library?

Finally, per the issue template for this project which you did not use, we need more information to assist. What kind of request were you making (appears to be a Shipment create request)? What version of the library is in use? What steps can we try to recreate the issue (does this happen on every request or just some)? Based on the file paths in what you shared, it looks like you are running this on Windows, is that correct?

from easypost-python.

rosenberg12 avatar rosenberg12 commented on September 7, 2024

Thank you for the answer. verify = False returns another error and that is ValueError: Cannot set verify_mode to CERT_NONE when check_hostname is enabled..
I installed the library under Anconda with pip install easypost.
I have the following requirements:

  • Request shipment.buy(rate=shipment.lowest_rate()) (example code see above)
  • Windows 10
  • Anaconda conda 4.13.0
  • Python 3.9.7

from easypost-python.

Justintime50 avatar Justintime50 commented on September 7, 2024

Disabling the check_hostname is not something that the requests library lets you do natively. You would need to build a urllib wrapper to be able to do this. Some potential resources:

As this issue falls outside the scope of our library and is related with the urllib/requests libraries, I'm going to close it. I would highly encourage fixing the SSL issue at the root instead of trying to disable it as it's an insecure method of working with APIs. Otherwise hopefully some of the above StackOverflow questions should point you in the right direction. Alternatively you could raise an issue on their GitHub pages instead on how to properly do this. Best of luck!

from easypost-python.

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.