Python Binance request blocked by internet provider - python

Currently, i am working to automate my binance account using python-binance 1.0.0++
Unfortunately, the web is blocked by the government but I still can access the web using public DNS (google / cloudflare) by setup the security settings. Or i can also add the DNS to my Network Adapter
But when I try the python-binance to get_all_orders, then the result still shows a scraped blocked landing page by our government even when i do browsing using the chrome / edge, no issue at all. I have tried to change the DNS at the browser and at Network Adapter. Nothing are work for me. The error is shown below.
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.binance.com', port=443): Max retries exceeded with url: /api/v3/ping (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))
Anyone can help me to do the same on my python as my browser work?

Related

SSL Certificate Error when using an API - troubleshooting methods

I cannot access the Darksky API (weather forecast API) from a python script on my home internet while it runs fine on the office internet. Also, when I paste the Darksky url on a web browser it works fine, too. I read somewhere that both office internet and web browser have their own intermediate certificates while my home internet may not.
This is the error message:
'HTTPSConnectionPool(host='api.darksky.net', port=443): Max retries exceeded with url: /forecast/key/lat,long?units=us&exclude=hourly,minutely,daily (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))']
I'm on a Linux machine. I've tried downloading PEM(cert) and PEM(chain) certificate files from the web browser and saving them to "/usr/local/share/ca-certificates" and "/etc/ssl/certs" folders. I then ran the "sudo update-ca-certificates" command. I've also tried changing the file extension to ".crt", but no luck.
What other troubleshooting methods are there? Thank you!

Does anyone know what this error code means? my program worked fine yesterday. "SSL: CERTIFICATE_VERIFY_FAILED"

====== WebDriver manager ======
Current google-chrome version is 91.0.4472
Get LATEST driver version for 91.0.4472
UNEXPECTED ERROR:
HTTPSConnectionPool(host='chromedriver.storage.googleapis.com', port=443): Max retries exceeded with url: /LATEST_RELEASE_91.0.4472 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
SSL verification errors can happen due to a number of reasons. Some of them are:
General network issues or outages
A real SSL issue, it is damaged or simply it has expired.
A new firewall rule that could be blocking your network traffic.
An antivirus software
A network security client ot network tool
A Python version/system libraries with SSL issues (2.7.11 seems to work for most users).
Verify you are not having any network or communication issues or changees; or new software that have installed on your computer.
Can you try again after upgrading to the latest version of Google Cloud SDK, and Python 2.7.11 and verify that none of these are the cause?
There are some procedures like this one or this one to try fo fix your issue.

Python suds: Getitng SSL: CERTIFICATE_VERIFY_FAILED error

I'm trying to request some data from a website using suds in Python. I'm getting urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)> while creating suds client. I do not get this error when I'm running the project locally but this issue happens when I try to deploy this project to a Linux host so that it can be automated.
One thing to note is, this python code lies behind AppProxy so that it can connect to internet. I have verified using a CURL request that the remote hosts is able to connect to the website.
I'm new to SSL Certificate thing not so sure about this certificate issue, do I need to install any server certificates on the hosts so that it can verified by SSL Validation? Any leads would be helpful. Thanks.

Python Requests fails on a specific HTTPS site, although its certificate is valid

We're using a Python package that internally uses requests to access an online service. The service is located at https://dsbox02.isi.edu:8888/ . If you follow the link with your browser, you'll see that the page opens up, and that it has a valid certificate.
The following Python code, however, fails:
import requests
requests.get('https://dsbox02.isi.edu:8888')
requests.exceptions.SSLError: HTTPSConnectionPool(host='dsbox02.isi.edu', port=8888): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)')))
This happens on Windows 10 and Python 3.7, Ubuntu 18.04 and Python 3.6 and the python:latest docker image, with Python 3.9. On a Mac with Python 3.8 it does work.
There are some ssl certificates that are not trusted in all web browsers. You may need to install an Intermediate/chain certificate to link it to a trusted root certificate.
The easiest way is to check your website with a ssl checker. Such as: https://www.sslshopper.com/ssl-checker.html#hostname=https://dsbox02.isi.edu:8888/

Snowflake AWS Privatelink - Python Connector Error Max retries exceeded with url: /session/v1/login-request?

we recently configured aws privatelink to snowflake account and updated python connector (v.1.8.0) properties to use privatelink URL.
Connection keeps failing with below error.
Failed to execute request: HTTPSConnectionPool(host='testaccount.us-west-2.privatelink.snowflakecomputing.com', port=443): Max retries exceeded with url: /session/v1/login-request?warehouse=TEST_WH&request_id=12345&request_guid=f5467 (Caused by ProtocolError('Connection aborted.', BadStatusLine("''",)))
Has anyone encountered this issue when using AWS privatelink?
Any inputs would be greatly appreciated.
On the host where you are running python, if linux or OSX, can you run:
curl -v -L https://testaccount.us-west-2.privatelink.snowflakecomputing.com:443
Do you know if you have a proxy in place allowing your Web URL to work?
https://www.digitalcitizen.life/how-set-proxy-server-all-major-internet-browsers-windows
That error is because the python code is unable to reach the privatelink URL. Either it's on a host that is blocked, there is a firewall blocking, or you require a proxy.

Categories

Resources