René's URL Explorer Experiment


Title: SDK does not respect SSL_CERT_FILE or REQUESTS_CA_BUNDLE environment variables · Issue #998 · massive-com/client-python · GitHub

Open Graph Title: SDK does not respect SSL_CERT_FILE or REQUESTS_CA_BUNDLE environment variables · Issue #998 · massive-com/client-python

X Title: SDK does not respect SSL_CERT_FILE or REQUESTS_CA_BUNDLE environment variables · Issue #998 · massive-com/client-python

Description: Problem The Polygon Python SDK fails with SSL certificate verification errors when used behind corporate firewalls that perform SSL/TLS inspection. The SDK does not respect standard SSL certificate environment variables (SSL_CERT_FILE, R...

Open Graph Description: Problem The Polygon Python SDK fails with SSL certificate verification errors when used behind corporate firewalls that perform SSL/TLS inspection. The SDK does not respect standard SSL certificate...

X Description: Problem The Polygon Python SDK fails with SSL certificate verification errors when used behind corporate firewalls that perform SSL/TLS inspection. The SDK does not respect standard SSL certificate...

Opengraph URL: https://github.com/massive-com/client-python/issues/998

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SDK does not respect SSL_CERT_FILE or REQUESTS_CA_BUNDLE environment variables","articleBody":"## Problem\n\nThe Polygon Python SDK fails with SSL certificate verification errors when used behind corporate firewalls that perform SSL/TLS inspection. The SDK does not respect standard SSL certificate environment variables (`SSL_CERT_FILE`, `REQUESTS_CA_BUNDLE`) that specify custom CA bundles.\n\n## Steps to Reproduce\n\n```python\nimport os\nfrom polygon import RESTClient\n\n# Set custom CA bundle (common in enterprise environments)\nos.environ[\"SSL_CERT_FILE\"] = \"/path/to/corporate-ca-bundle.pem\"\n\n# This fails with SSL error\nclient = RESTClient(os.getenv(\"POLYGON_API_KEY\"))\naggs = client.get_aggs(ticker=\"AAPL\", multiplier=1, timespan=\"day\",\n                       from_=\"2026-02-01\", to=\"2026-02-10\")\nlist(aggs)  # SSLError: certificate verify failed\n```\n\n## Expected Behaviour\n\nSDK should respect SSL environment variables like other Python HTTP libraries (requests, httpx, urllib3).\n\n## Actual Behaviour\n\n```\nSSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:\nself-signed certificate in certificate chain\n```\n\nSDK ignores environment variables and uses bundled certifi CA bundle only.\n\n## Evidence\n\n**Raw Python SSL (works):**\n```python\nimport ssl, socket\ncontext = ssl.create_default_context()\nwith socket.create_connection((\"api.polygon.io\", 443)) as sock:\n    with context.wrap_socket(sock, server_hostname=\"api.polygon.io\") as s:\n        print(s.version())  # ✅ TLSv1.3 - Success!\n```\n\n**Polygon SDK (fails):**\nUses bundled certs, ignores `SSL_CERT_FILE` → certificate verification fails.\n\n## Root Cause\n\nThe SDK uses `urllib3` but doesn't configure it to check standard SSL environment variables. While `urllib3` supports custom CA bundles, the Polygon SDK never provides them.\n\n## Comparison: Alpaca SDK (Works Correctly)\n\n```python\n# Alpaca SDK respects SSL_CERT_FILE and works behind corporate firewalls\nfrom alpaca.data.historical import StockHistoricalDataClient\nclient = StockHistoricalDataClient(api_key, secret_key)\nbars = client.get_stock_bars(...)  # ✅ Works!\n```\n\n## Suggested Fix\n\nCheck environment variables when creating HTTP client:\n\n```python\nimport os\nimport certifi\n\ndef get_ca_bundle():\n    \"\"\"Get CA bundle from environment or default.\"\"\"\n    return (os.getenv(\"SSL_CERT_FILE\") or\n            os.getenv(\"REQUESTS_CA_BUNDLE\") or\n            certifi.where())\n\n# Use in RESTClient\nhttp = urllib3.PoolManager(cert_reqs=\"CERT_REQUIRED\",\n                           ca_certs=get_ca_bundle())\n```\n\n## Impact\n\n**Affects:** Enterprise users behind corporate firewalls with SSL inspection (finance, healthcare, government sectors)\n\n**Current workarounds:** All unacceptable for production:\n- ❌ Disable SSL verification (insecure)\n- ❌ Switch to different provider\n- ❌ Maintain local SDK patches\n\n## Environment\n\n- **Python:** 3.10+\n- **OS:** macOS/Linux\n- **Network:** Corporate firewall with SSL inspection (Zscaler, etc.)\n- **polygon-api-client:** Latest\n\n## References\n\n- urllib3 docs: https://urllib3.readthedocs.io/en/stable/advanced-usage.html#custom-ssl-certificates\n- Example implementation: [alpaca-py SDK](https://github.com/alpacahq/alpaca-py)\n- Standard practice: requests, httpx, aiohttp all respect these env vars\n\nHappy to submit a PR if maintainers are open to this fix.\nThis issue generated with AI/Claude 4.6\n","author":{"url":"https://github.com/farmerbean","@type":"Person","name":"farmerbean"},"datePublished":"2026-02-12T16:50:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/998/client-python/issues/998"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:53fbb8af-243c-6161-3664-aa1754e2162b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE1DE:F61E5:180B625:2186024:6A4DF653
html-safe-noncebce226858543747ccff165b31debf3124a90b059d667efc0e192d3c7f52cb824
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMURFOkY2MUU1OjE4MEI2MjU6MjE4NjAyNDo2QTRERjY1MyIsInZpc2l0b3JfaWQiOiI4NzI5ODA1MjQxNzc0MzcyNDM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3c9f45b0bfa2edc104df71ef06b14babd40faaf15aeba1f994adb3dc7762bcdd
hovercard-subject-tagissue:3932862906
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/massive-com/client-python/998/issue_layout
twitter:imagehttps://opengraph.githubassets.com/686d061e3bee7f15ec5a5fe20b67358fcb3a27817ec2b3a294caf71b670cc7b6/massive-com/client-python/issues/998
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/686d061e3bee7f15ec5a5fe20b67358fcb3a27817ec2b3a294caf71b670cc7b6/massive-com/client-python/issues/998
og:image:altProblem The Polygon Python SDK fails with SSL certificate verification errors when used behind corporate firewalls that perform SSL/TLS inspection. The SDK does not respect standard SSL certificate...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefarmerbean
hostnamegithub.com
expected-hostnamegithub.com
None5818716c93c6a2925b815402541a32814e43a7b1261c322b0c2df75224289566
turbo-cache-controlno-preview
go-importgithub.com/massive-com/client-python git https://github.com/massive-com/client-python.git
octolytics-dimension-user_id191946194
octolytics-dimension-user_loginmassive-com
octolytics-dimension-repository_id216660192
octolytics-dimension-repository_nwomassive-com/client-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id216660192
octolytics-dimension-repository_network_root_nwomassive-com/client-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4314b1df11fa8a565684f3a72dc971e3785da365
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/massive-com/client-python/issues/998#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmassive-com%2Fclient-python%2Fissues%2F998
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmassive-com%2Fclient-python%2Fissues%2F998
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=massive-com%2Fclient-python
Reloadhttps://github.com/massive-com/client-python/issues/998
Reloadhttps://github.com/massive-com/client-python/issues/998
Reloadhttps://github.com/massive-com/client-python/issues/998
Please reload this pagehttps://github.com/massive-com/client-python/issues/998
massive-com https://github.com/massive-com
client-pythonhttps://github.com/massive-com/client-python
Notifications https://github.com/login?return_to=%2Fmassive-com%2Fclient-python
Fork 356 https://github.com/login?return_to=%2Fmassive-com%2Fclient-python
Star 1.5k https://github.com/login?return_to=%2Fmassive-com%2Fclient-python
Code https://github.com/massive-com/client-python
Issues 12 https://github.com/massive-com/client-python/issues
Pull requests 6 https://github.com/massive-com/client-python/pulls
Actions https://github.com/massive-com/client-python/actions
Security and quality 0 https://github.com/massive-com/client-python/security
Insights https://github.com/massive-com/client-python/pulse
Code https://github.com/massive-com/client-python
Issues https://github.com/massive-com/client-python/issues
Pull requests https://github.com/massive-com/client-python/pulls
Actions https://github.com/massive-com/client-python/actions
Security and quality https://github.com/massive-com/client-python/security
Insights https://github.com/massive-com/client-python/pulse
SDK does not respect SSL_CERT_FILE or REQUESTS_CA_BUNDLE environment variableshttps://github.com/massive-com/client-python/issues/998#top
https://github.com/farmerbean
farmerbeanhttps://github.com/farmerbean
on Feb 12, 2026https://github.com/massive-com/client-python/issues/998#issue-3932862906
https://urllib3.readthedocs.io/en/stable/advanced-usage.html#custom-ssl-certificateshttps://urllib3.readthedocs.io/en/stable/advanced-usage.html#custom-ssl-certificates
alpaca-py SDKhttps://github.com/alpacahq/alpaca-py
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.