summaryrefslogtreecommitdiffstats
path: root/master/mitmproxy
diff options
context:
space:
mode:
Diffstat (limited to 'master/mitmproxy')
-rw-r--r--master/mitmproxy78
1 files changed, 78 insertions, 0 deletions
diff --git a/master/mitmproxy b/master/mitmproxy
new file mode 100644
index 0000000..93ee2c5
--- /dev/null
+++ b/master/mitmproxy
@@ -0,0 +1,78 @@
+diff --git a/package/jmm/python-mitmproxy/Makefile b/package/jmm/python-mitmproxy/Makefile
+new file mode 100644
+index 0000000..59a63c7
+--- /dev/null
++++ b/package/jmm/python-mitmproxy/Makefile
+@@ -0,0 +1,35 @@
++include $(TOPDIR)/rules.mk
++
++PKG_NAME:=python-mitmproxy
++PKG_VERSION:=3.0.0
++PKG_RELEASE:=1
++
++PKG_SOURCE_PROTO:=git
++PKG_SOURCE_URL:=https://github.com/mitmproxy/mitmproxy.git
++PKG_SOURCE_DATE:=2020-06-19
++PKG_SOURCE_VERSION:=8e5c62c1691b842ca2032cc8ac4d4ca5d0be8490
++PKG_MAINTAINER:=me <me@me.me>
++PKG_LICENSE:=GPL-2.0
++
++#include ../../feeds/packages/python3/../pypi.mk
++include $(INCLUDE_DIR)/package.mk
++include ../../feeds/packages/python3/../python3-package.mk
++
++define Package/python3-mitmproxy
++ SECTION:=lang
++ CATEGORY:=Languages
++ SUBMENU:=Python
++ TITLE:=mitmproxy
++ DEPENDS:=+python3-light +python3-blinker +python3-brotli +python3-certifi +python3-click +python3-cryptography +python3-flask +python3-h2 +python3-hyperframe +python3-kaitaistruct +python3-ldap3 +python3-passlib +python3-protobuf +python3-pyasn1 +python3-pyopenssl +python3-pyparsing +python3-pyperclip +python3-ruamel.yaml +python3-sortedcontainers +python3-tornado +python3-urwid +python3-wsproto +python3-publicsuffix2 +python3-zstandard +python3-h11 +python3-ruamel.yaml.clib +python3-hpack
++ VARIANT:=python3
++endef
++
++HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="setuptools_scm[toml] >= 3.4.1"
++
++define Package/python3-mitmproxy/description
++ mitmproxy
++endef
++
++$(eval $(call Py3Package,python3-mitmproxy))
++$(eval $(call BuildPackage,python3-mitmproxy))
++$(eval $(call BuildPackage,python3-mitmproxy-src))
+diff --git a/package/jmm/python-mitmproxy/patches/001-pkcs11-client-certs.patch b/package/jmm/python-mitmproxy/patches/001-pkcs11-client-certs.patch
+new file mode 100644
+index 0000000..466ba1c
+--- /dev/null
++++ b/package/jmm/python-mitmproxy/patches/001-pkcs11-client-certs.patch
+@@ -0,0 +1,31 @@
++diff --git a/mitmproxy/net/tls.py b/mitmproxy/net/tls.py
++index 4c0f1d6b..0fe4c1d1 100644
++--- a/mitmproxy/net/tls.py
+++++ b/mitmproxy/net/tls.py
++@@ -296,7 +296,25 @@ def create_client_context(
++ # Client Certs
++ if cert:
++ try:
++- context.use_privatekey_file(cert)
+++ if os.path.exists(cert + ".pkcs11" ):
+++ with open(cert + ".pkcs11", 'r') as f:
+++ pkcs11_url = f.read()
+++
+++ pkcs11_url = pkcs11_url.rstrip("\n");
+++
+++ engine = SSL._lib.ENGINE_by_id( b"pkcs11" )
+++ SSL._lib.ENGINE_init(engine)
+++
+++ _pkey = SSL._lib.ENGINE_load_private_key( engine, bytes(pkcs11_url, 'ascii'), SSL._ffi.NULL, SSL._ffi.NULL )
+++
+++ pkey = SSL.PKey()
+++ pkey._pkey = _pkey
+++ pkey._initialized = True
+++
+++ context.use_privatekey(pkey)
+++ else:
+++ context.use_privatekey_file(cert)
+++
++ context.use_certificate_chain_file(cert)
++ except SSL.Error as v:
++ raise exceptions.TlsException("SSL client certificate error: %s" % str(v))