Commit 83c752e4 authored by Michał Polański's avatar Michał Polański Committed by Leo

testing/mitmproxy: upgrade to 5.3.0

parent 3c03b729
Pipeline #64412 skipped
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=mitmproxy
pkgver=0.18.2
pkgrel=3
pkgdesc="An interactive SSL-capable intercepting HTTP proxy"
url="https://www.mitmproxy.org/"
arch="noarch"
pkgver=5.3.0
pkgrel=0
pkgdesc="Interactive TLS-capable intercepting HTTP proxy"
url="https://mitmproxy.org/"
license="MIT"
depends="python3 py3-flask py3-urwid py3-$pkgname py3-itsdangerous"
makedepends="py3-setuptools"
subpackages="py3-$pkgname:_py"
source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz"
arch="noarch !s390x !armhf" # limited by py3-zstandard
depends="
python3
py3-setuptools
py3-asgiref
py3-blinker
py3-brotli
py3-click
py3-cryptography
py3-flask
py3-h2
py3-hyperframe
py3-kaitaistruct
py3-ldap3
py3-msgpack
py3-passlib
py3-protobuf
py3-asn1
py3-openssl
py3-parsing
py3-pyperclip
py3-ruamel.yaml
py3-sortedcontainers
py3-tornado
py3-urwid
py3-wsproto
py3-publicsuffix2
py3-zstandard
"
checkdepends="
py3-hypothesis
py3-parver
py3-pytest
py3-pytest-asyncio
py3-requests
"
source="$pkgname-$pkgver.tar.gz::https://github.com/mitmproxy/mitmproxy/archive/v$pkgver.tar.gz
use-system-ca-certificates.patch"
prepare() {
default_prepare
# remove test file importing asynctest module, which doesn't support python3.8
# see: https://github.com/Martiusweb/asynctest/issues/132
rm test/mitmproxy/addons/test_readfile.py
# relax constraints on required dependencies
sed -E "s/, *<[0-9=.]*//" -i setup.py
# remove unneeded dependency on certifi
sed "/certifi/d" -i setup.py
}
build() {
python3 setup.py build
}
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir"
check() {
pytest --deselect "test/mitmproxy/test_version.py::test_get_version"
}
_py() {
cd "$builddir"
pkgdesc="$pkgname python3 bindings"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir" --skip-build
# remove deprecated tooling: https://github.com/mitmproxy/mitmproxy/pull/4296
rm "$pkgdir"/usr/bin/pathoc "$pkgdir"/usr/bin/pathod
rm -r "$pkgdir"/usr/lib/python3.*/site-packages/pathod
}
sha512sums="39836063a041d7fd14bb82ccf2fb53262b8ec14b629197776e27ebfb2fc97103ee5b4af979ffe6db35103e833679e2e5a640295831d55a2cd0f20a602b559064 mitmproxy-0.18.2.tar.gz"
sha512sums="3f52f5285869de49c7c04ef9b6c0f3ef66689eb45fb6f9e971111049bf1aa0777e3e84b51f7031c1bdf105ce3f17fa4b03036d72617985b92996c6eea7566c38 mitmproxy-5.3.0.tar.gz
c8f19067394169c2e85f203351b8a4753bec3bc6498fc184fd4691e8a9f60a60de3c671285b36c6808e209d87254a329eff296efd12b79702153e029754e7c5c use-system-ca-certificates.patch"
Upstream: No
Reason: Use system CA certificates
diff --git a/mitmproxy/net/tls.py b/mitmproxy/net/tls.py
index 8e217ec0c..125d9874f 100644
--- a/mitmproxy/net/tls.py
+++ b/mitmproxy/net/tls.py
@@ -8,7 +8,6 @@ import struct
import threading
import typing
-import certifi
from OpenSSL import SSL
from kaitaistruct import KaitaiStream
@@ -178,7 +177,7 @@ def _create_ssl_context(
if verify is not None:
context.set_verify(verify, verify_callback)
if ca_path is None and ca_pemfile is None:
- ca_pemfile = certifi.where()
+ ca_pemfile = "/etc/ssl/certs/ca-certificates.crt"
try:
context.load_verify_locations(ca_pemfile, ca_path)
except SSL.Error:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment