Using urllib3 library at work throws an SSL verification error.
When I explicitly use urllib3, I know how to avoid it using
import urllib3
c = urllib3.HTTPSConnectionPool('10.0.3.168', port=9001, cert_reqs='CERT_NONE', assert_hostname=False)
c.request('GET', '/')
as explained in Ignore certificate validation with urllib3
But a library calls another library and it calls another and uses urllib3 inside it, I don't know how to avoid SSL verification. I think revising the code inside the .py files in the folder /somepath/anaconda3/lib/site-packages/urllib3 solves the problem but cannot find which part I should revise.
Try changing connectionpool.py file. Look for super().init method and change this line:
self.assert_hostname = assert_hostname
to
self.assert_hostname = False
Related
I'm trying to configure a Remix app to use i18next module for translations.
So far I've been following the guide on Github: https://github.com/sergiodxa/remix-i18next
It seems okay except I can't get node:path to resolve to a module.
I tried a few different things:
Updated nvm to use node 18 instead of 17. Neither works.
I also tried using const path = require('path') which works but then throws a different error trying to load the resource files.
I needed to remove the changeLanguage code in root.tsx to get it to start.
I'd like to isolate it by first trying to fix why the node:path isn't resolving so if someone could help with that, it would be a start?
Debug mode recommends: You can mark the path "node:path" as external to exclude it from the bundle, which will remove this error
But how do I mark it 'external' and what does that mean?
I have created an authentication module which was build against
ejabberd 16.02 and runs fine when auth_method is set. It also works against
16.03.
However, from 16.04 onwards it gives me the error "[error] ignoring
option 'auth_method' with invalid value: [jwt]"
I checked the code diff between those releases and the only change
seems to be to the mod_pubsub.erl file, specifically adding the
following:
ServerHost = serverhost(Host),
+ ejabberd_hooks:run(pubsub_subscribe_node, ServerHost,
+ [ServerHost, Host, Node, Subscriber, SubId]),
https://github.com/processone/ejabberd/commit/639c2fb6401391663206c0e4c946d1a699689ac7
I have tried disabling this module and even deleting the beam file as
i don't use it, but i can't seem ti get round it.
Does anyone have any insight as to why these changes will have broken
my authentication module?
My source is at the link below, but as i say has worked fine for a year:
https://github.com/ParamountVentures/ejabberd-auth-jwt
The answer is that from 16.04 onwards you need to drop the .erl file into the ejabberd src folder and compile it with the source. Dropping in the .beam file to use alternative authentication modules no longer works.
I'm trying to generate an SSL cert.
But I've run into this error while doing so:
The ordinal 372 could not be located in the dynamic link library C:\wamp64\bin\apache\apache2.4.7\bin\openssl.exe
I've been searching around for awhile but the solutions aren't detailed enough. I've also no experience in generating SSL certs.
I've also tried using dependency walker and it generated:
Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Warning: At least one delay-load dependency module was not found.
But I don't know how to continue from here.
Please provide detailed solution on how to resolve this and generate an SSL cert. Thanks.
How to clone with disabled SSL checking, using GitPython library. The following code ...
import git
x = git.Repo.clone_from('https://xxx', '/home/xxx/lala')
... yields this error:
Error: fatal: unable to access 'xxx': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
I know about "export GIT_SSL_NO_VERIFY=1", but how to implement it in a python library ?
The two following methods have been tested with GitPython 2.0.8 but should be working at least since 1.0.2 (from the doc).
As suggested by #Byron:
git.Repo.clone_from(
'https://example.net/path/to/repo.git',
'local_destination',
branch='master', depth=1,
env={'GIT_SSL_NO_VERIFY': '1'},
)
As suggested by #Christopher:
git.Repo.clone_from(
'https://example.net/path/to/repo.git',
'local_destination',
branch='master', depth=1,
config='http.sslVerify=false',
)
It seems easiest to pass the GIT_SSL_NO_VERIFY environment variable to all git invocations. Unfortunately Git.update_environment(...) can only be used on an existing instance, which is why you would have to manipulate python's environment like so:
import git
import os
os.environ['GIT_SSL_NO_VERIFY'] = "1"
repo = git.Repo.clone_from('https://xxx', '/home/xxx/lala')
I try to use gem rest client to access some simple REST service, I have installed the rest-client following these instructions, but when try to use the library, I get the following error no such file to load -- rest_client.
It seems that the library is not recognized.
Did anyone have similar problems with this library?
Make sure you add it to your Gemfile, bundle install, restart server, and if required, require 'rest_client' or whatever the file name is.