2020-12-29 00:16:55 +00:00
|
|
|
import secrets
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
import objgraph
|
|
|
|
|
|
|
|
from mitmproxy import certs
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2022-04-26 11:53:35 +00:00
|
|
|
store = certs.CertStore.from_store(
|
|
|
|
path=Path("~/.mitmproxy/").expanduser(), basename="mitmproxy", key_size=2048
|
|
|
|
)
|
2020-12-29 00:16:55 +00:00
|
|
|
store.STORE_CAP = 5
|
|
|
|
|
|
|
|
for _ in range(5):
|
2022-04-26 11:53:35 +00:00
|
|
|
store.get_cert(
|
|
|
|
commonname=secrets.token_hex(16).encode(), sans=[], organization=None
|
|
|
|
)
|
2020-12-29 00:16:55 +00:00
|
|
|
|
|
|
|
objgraph.show_growth()
|
|
|
|
|
|
|
|
for _ in range(20):
|
2022-04-26 11:53:35 +00:00
|
|
|
store.get_cert(
|
|
|
|
commonname=secrets.token_hex(16).encode(), sans=[], organization=None
|
|
|
|
)
|
2020-12-29 00:16:55 +00:00
|
|
|
|
|
|
|
print("====")
|
|
|
|
objgraph.show_growth()
|