我安装了 mitmproxy 并启动了它 - 然后我将它的 CA 证书添加到 ubuntu 接受的 CA(复制到 /usr/local/share/ca-certificates/ 并添加到使用 update-ca-certificates 接受的证书).c...
我安装了 mitmproxy 并启动了它 - 然后我将它的 CA 证书添加到 ubuntu 接受的 CA(复制到 /usr/local/share/ca-certificates/ 并使用 update-ca-certificates 添加到接受中)。
curl www.google.com --proxy 127.0.0.1:8080
现在可以在没有警告的情况下运行。但是当我启动我的 dotnet 应用程序(在连接到 wsl2 的 vs code 中)并尝试访问外部 API 时,我得到了
> The SSL connection could not be established, see inner exception.
> ---> Azure.RequestFailedException: The SSL connection could not be established, see inner exception.
> ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
> ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate
> chain: RevocationStatusUnknown, OfflineRevocation
(我 http://127.0.0.1:8080 http://127.0.0.1:8080
有什么想法可以确保 dotnet 接受我的 mitm 证书,以便我可以看到 mitmproxy 中的流量?
我的setup.py文件中有一个代码:from setuptools import setup, find_packages setup(name='PBI_telegrambot',version='0.0.1',author='junscience',description='Embedding app for
我的 setup.py 文件中有一个代码:
from setuptools import setup, find_packages
setup(
name='PBI_telegrambot',
version='0.0.1',
author='junscience',
description='Embedding app for classification',
packages=find_packages(include =['telegram_bot.py', 'login.py', 'screenshot.py']),
scripts=['telegram_bot.py'],
entry_points={
'console_scripts':[
'PBI_telegrambot=telegram_bot:main'
]
}
)
我的项目树如下所示:
build
bdist.linux-x86_64
scripts-3.8
telegram_bot.py
dist
PBI_telegrambot-0.0.1-py3.8.egg
env.txt
login.py
PBI_telegrambot.egg-info
dependency_links.txt
entry_points.txt
PKG-INFO
requires.txt
SOURCES.txt
top_level.txt
pycache
login.cpython-311.pyc
screenshot.cpython-311.pyc
requirements.txt
screenshot.py
setup.py
telegram_bot.py
首先,我安装要求,通过: pip install -r requirements.txt
我尝试在 Ubuntu 中安装代码: sudo python3 setup.py install
并运行它: PBI_telegrambot
但收到错误:
/usr/lib/python3/dist-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (2.2.2) or chardet (5.2.0) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
File "/usr/local/bin/PBI_telegrambot", line 11, in <module>
load_entry_point('PBI-telegrambot==0.0.1', 'console_scripts', 'PBI_telegrambot')()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/bin/telegram_bot.py", line 4, in <module>
import('pkg_resources').run_script('PBI-telegrambot==0.0.1', 'telegram_bot.py')
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 667, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1452, in run_script
raise ResolutionError(
pkg_resources.ResolutionError: Script 'scripts/telegram_bot.py' not found in metadata at '/home/user/.local/lib/python3.8/site-packages/PBI_telegrambot-0.0.1.dist-info'
将非常感谢您的帮助!
我尝试使用 pip: 创建一个项目 pip install .
,但遇到了同样的问题