Systematic approach to diagnosing and resolving SSL/proxy connectivity issues with restricted websites
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-ssl-proxy-troubleshoot-fb786c-2a98cfb549c6 ,按照其中的说明把「ssl-proxy-troubleshoot-fb786c」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
This skill provides a structured workflow for diagnosing and resolving network connectivity issues when accessing government websites, corporate portals, or other restricted domains that commonly exhibit SSL certificate problems, proxy requirements, or access restrictions.
Apply this skill when:
Test basic connectivity before attempting complex solutions:
# Test DNS resolution
nslookup target-domain.gov
dig target-domain.gov
# Test basic TCP connectivity
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/target-domain.gov/443' && echo "Port 443 open" || echo "Port 443 closed"
# Test with curl (verbose)
curl -v https://target-domain.gov 2>&1 | head -50
If SSL errors occur, diagnose the certificate issue:
# Check certificate details
openssl s_client -connect target-domain.gov:443 -servername target-domain.gov 2>/dev/null | openssl x509 -noout -dates -subject -issuer
# Test with different SSL versions
curl --tlsv1.2 -v https://target-domain.gov
curl --tlsv1.3 -v https://target-domain.gov
# Try disabling verification (testing only)
curl -k https://target-domain.gov
Test various proxy configurations:
# Try without proxy
curl --noproxy "*" https://target-domain.gov
# Try with system proxy
curl -x http://proxy.example.com:8080 https://target-domain.gov
# Try explicit no-proxy for .gov domains
export no_proxy=".gov,.mil,.edu"
curl https://target-domain.gov
# Test with different proxy protocols
curl -x http://proxy:8080 https://target-domain.gov
curl -x https://proxy:8080 https://target-domain.gov
curl -x socks5://proxy:1080 https://target-domain.gov
Test alternative access methods:
# Try HTTP instead of HTTPS
curl http://target-domain.gov
# Try alternative ports
curl https://target-domain.gov:8443
curl https://target-domain.gov:4443
# Try www subdomain variation
curl https://www.target-domain.gov
# Try alternative domain extensions
curl https://target-domain.state.il.us
Some sites block automated access:
# Use browser user-agent
curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" https://target-domain.gov
# Add common headers
curl -H "Accept: text/html" -H "Accept-Language: en-US" https://target-domain.gov
# Include referer header
curl -e "https://www.google.com/" https://target-domain.gov
If curl fails, try Python with different configurations:
import requests
from requests.adapters import HTTPAdapter
# Disable SSL verification (testing only)
session = requests.Session()
session.verify = False
session.mount('https://', HTTPAdapter())
try:
response = session.get('https://target-domain.gov', timeout=30)
print(f"Status: {response.status_code}")
except Exception as e:
print(f"Error: {e}")
# Try with custom SSL context
import ssl
context = ssl.create_default_context()
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
When primary data sources remain inaccessible after exhausting troubleshooting:
When access fails after systematic troubleshooting:
## Access Attempt Summary
- **Target**: [domain]
- **Methods Tried**: [list all approaches]
- **Errors Encountered**: [specific error messages]
- **Time Spent**: [duration]
- **Recommendation**: [alternative sources or next steps]
SSL Error?
├── Yes → Try curl -k (test only)
│ ├── Works → Document SSL issue, proceed with verification disabled
│ └── Fails → Continue diagnostics
│
Proxy Issue?
├── Suspected → Try --noproxy "*"
│ ├── Works → Configure no_proxy for target domain
│ └── Fails → Try explicit proxy settings
│
Timeout/Refused?
├── Yes → Try HTTP instead of HTTPS
│ Try alternative ports
│ Try www subdomain
│ └── All fail → Implement fallback strategies
│
All Methods Fail?
└── Implement fallback strategies and document attempts
Security Considerations: Disabling SSL verification should only be used for diagnosis in trusted environments. Never use in production without understanding the risks.
Rate Limiting: Add delays between requests to avoid triggering rate limits or IP blocks.
Documentation: Always document which methods were tried and their results for future reference.
Iteration Limit: If 5+ distinct approaches fail, pivot to fallback strategies rather than continuing to iterate on the same blocked endpoint.
Legal Compliance: Ensure all access attempts comply with terms of service and applicable laws.
This troubleshooting workflow is complete when: