How to disable SSL certificate verification in Twine? - ssl-certificate

When I tried to push a new package to my company's artifactory :
python -m twine upload --repository-url https:///artifactory/api/pypi/gdp_pypi dist/*
I got an error on SSL.
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)
Any way to disable the SSL verification?

I just tried the solution by another post:
Disable Python requests SSL validation for an imported module
Simply setting environment variable CURL_CA_BUNDLE to an empty string did the job!
$ export CURL_CA_BUNDLE=""

Related

Issues installing nvs, laptop has Zscaler and cannot be deactivated

I'm using Windows 10 using Git Bash.
My company's laptop uses Zscaler and I've trying to get nvs from this repository:
https://github.com/jasongin/nvs#nvs-node-version-switcher
export NVS_HOME="$HOME/.nvs"
git clone https://github.com/jasongin/nvs "$NVS_HOME"
. "$NVS_HOME/nvs.sh" install
The first issue I got was error 60:
cURL error 60: SSL certificate problem: unable to get local issuer certificate and send me to cURL documentation.
These errors are potentially caused by Zscaler. I went to this website: https://help.zscaler.com/zia/adding-custom-certificate-application-specific-trusted-store and added the CA following this:
Exporting Zscaler root certificate
You will need to export the Zscaler root certificate to be able to add it to application custom trust store. To do this with Chrome follow the steps below. Different browsers will have different ways of doing this, google as required.
Settings
Privacy and Security
Manage Certificates
Trusted Root Certification Authorities
Select Zscaler Root CA
Export using the Wizard (DER .cer format)
I converted from .cer to .pem
Then added the cacert certification:
echo "cacert=<Path to Certificate>/ZscalerRootCA.pem" >> $HOME/.curlrc
After doing that, the new error I got is this:
curl: (77) error setting certificate verify locations: CAfile: /c/Users/xxx/CAZscaller/rootAM.pem CApath: none
Failed to download node binary.
If anyone has any idea on how can I fix this and finally get access to nvs I really appreciated. (Please note I'm not using PHP).

"There was a problem confirming the ssl certificate" when doing pip install on a local artifactory repository

I could use some guidance on what needs to be put in place for resolving this SSL issue to an artifactory server when running
pip install. Is this "self signed certificate" supposed to be replaced by a specific one provided by that server?
Could not fetch URL [our.artifactory.server.name]/simple/hercl/:
There was a problem confirming the ssl certificate: HTTPSConnectionPool
(host='[our.artifactory.server.name]', port=443):
Max retries exceeded with url:
/api/pypi/our.artifactory.server.name-local/simple/hercl/ (Caused by SSLError(SSLCertVerificationError(1,
'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
self signed certificate in certificate chain (_ssl.c:1131)'))) - skipping
Credited to pip.pypa.io:
Starting with v1.3, pip provides SSL certificate verification over
HTTP, to prevent man-in-the-middle attacks against PyPI downloads.
This does not use the system certificate store but instead uses a
bundled CA certificate store. The default bundled CA certificate store
certificate store may be overridden by using --cert option or by using
PIP_CERT, REQUESTS_CA_BUNDLE, or CURL_CA_BUNDLE environment variables.
In regards to the SSL issue, it depends whether you insist on SSL enforcement, if not, you may use an existing flag to ignore this by appending --trusted-host <server_name> ,in the example below: --trusted-host artifactory.
Some suggestions raised to overcome this issue are suggested here as well: pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"
Do note, prior to using artifactory as a caching/proxy server for Pypi packages, you should configure the pip.conf and .pypirc files according to the SetMeUp instructions: https://www.jfrog.com/confluence/display/JFROG/PyPI+Repositories#PyPIRepositories-ResolvingfromArtifactoryUsingpip
For example:
pip.conf:
[global]
index-url = http://artifactory:8081/artifactory/api/pypi/pypi-virtual/simple
.pypirc:
[distutils]
index-servers =
virtual
local
remote
devpi
[virtual]
repository: http://artifactory:8081/artifactory/api/pypi/pypi-virtual
username: admin
password: ***
[local]
repository: http://artifactory:8081/artifactory/api/pypi/pypi-local
username: admin
password: ***
[remote]
repository: http://artifactory:8081/artifactory/api/pypi/pypi-org-remote
username: admin
password: ***
[devpi]
repository: http://localhost:3141/admin/dev
username: admin
password: ***

Client unable to verify SSL certificate even when verification is disabled

I am disabling certificate verification using the following command:
getsessionkey = requests.post(AUTH_URL, headers=headers, data=data, verify=False)
I use above command in a script that calls an API to retrieve data from it. When I run my script, I have the following error:
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)
I understand from that error that the script could not verify the distant's API certificate. But I am explicitely disabling the verification, I am at loss as to how to interpret this.
If the problem cannot be resolved, how can I add my certificate to the certificate truststore?
P.S: Disabling certificate verification has always worked for me so far. I started to have the error above since a recent security update.
Thanks for helping.

svn: E230001: Server SSL certificate verification failed: issuer is not trusted

I am using the svnX Version 2.0 (2.0.017068) and I can't connect. We already have a certificate for it, but it is giving me these errors:
svn: E170013: Unable to connect to a repository at URL 'https://svn.sample.com/svn/web'
svn: E230001: Server SSL certificate verification failed: issuer is not trusted
It suddenly happened to me today. I followed the steps from Rick: https://community.smartbear.com/t5/Collaborator/Server-SSL-Certificate-verification-failed-issues-is-not-trusted/td-p/96838
Please try running an "svn ls" or something similar from inside your working/checkout directory. You should be prompted to accept the certificate, make sure that you accept it permanently.
I did an svn update on the working directory.
Automatically, it asked me to accept the certificate.
Just accept it.

How to avoid certificate verification issues?

I'm trying to push to a Bitbucket Mercurial repository but I keep hitting the same problem:
ruihpacheco at descartes in ~/chi/aaa/cpp/ninja (default)
$ hg push
pushing to https://rhpacheco#bitbucket.org/rhpacheco/databaseclient
abort: error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
I've already tried what's on the website but it doesn't seem to work. Any suggestions?
With this in your .hgrc file:
[hostsecurity]
bitbucket.org:fingerprints = sha1:3F:D3:C5:17:23:3C:CD:F5:2D:17:76:06:93:7E:EE:97:42:21:14:AA
Do you get the same error?