Skip to content

Commit 07b2680

Browse files
committed
Test out memory limiting to see if we can trip the limit
1 parent ba3f080 commit 07b2680

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/truststore/_macos.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,13 @@ def _verify_peercerts_impl(
389389
ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks),
390390
)
391391
CoreFoundation.CFArrayAppendValue(policies, ssl_policy)
392-
CoreFoundation.CFRelease(ssl_policy)
392+
# CoreFoundation.CFRelease(ssl_policy)
393393
revocation_policy = Security.SecPolicyCreateRevocation(
394394
kSecRevocationUseAnyAvailableMethod
395395
| kSecRevocationRequirePositiveResponse
396396
)
397397
CoreFoundation.CFArrayAppendValue(policies, revocation_policy)
398-
CoreFoundation.CFRelease(revocation_policy)
398+
# CoreFoundation.CFRelease(revocation_policy)
399399
elif ssl_context.verify_flags & ssl.VERIFY_CRL_CHECK_LEAF:
400400
raise NotImplementedError("VERIFY_CRL_CHECK_LEAF not implemented for macOS")
401401

src/truststore/_windows.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ def _verify_peercerts_impl(
396396
else:
397397
raise
398398
finally:
399-
CertCloseStore(hIntermediateCertStore, 0)
399+
# CertCloseStore(hIntermediateCertStore, 0)
400400
if pCertContext:
401-
CertFreeCertificateContext(pCertContext)
401+
pass # CertFreeCertificateContext(pCertContext)
402402

403403

404404
def _get_and_verify_cert_chain(

tests/test_memory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def run_requests():
2424
ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
2525
for _ in range(10000):
2626
with urllib3.PoolManager(ssl_context=ctx) as http:
27-
http.request("GET", server.base_url)
27+
http.request("HEAD", server.base_url)
2828
http.clear() # Close connections so we get new ones.
2929

3030
thread = asyncio.to_thread(run_requests)

0 commit comments

Comments
 (0)