在macOS系统上,当urllib3库使用SecureTransport作为SSL/TLS后端时,可能出现ValueError("SecureTransport does not support cert directories")错误。出现原因是SecureTransport不支持证书目录验证。解决方法包括使用certifi证书包或明确指定证书路径。通过设置环境变量REQUESTS_CA_BUNDLE也可指定证书文件路径。示例代码展示了解决方法。