要繞過證書驗證并忽略SSL證書檢查,可以使用curl
的-k
或--insecure
選項。這允許curl
在連接到HTTPS站點時忽略證書錯誤。你可以這樣做:
curl -k https://220.181.49.193:10010/sms/11011200002020000001/flv/hls/11010000021321001788_11010000021321001788.flv -o test.mp4
如果你需要在Nginx代理配置中忽略證書驗證,可以在配置中添加以下內容:
- Nginx配置文件:
修改你的Nginx配置文件(例如/etc/nginx/nginx.conf
),以確保包含以下內容來忽略SSL證書檢查:
http {resolver 8.8.8.8; # 指定DNS服務器server {listen 8888;# 處理CONNECT方法的請求,用于代理HTTPS流量proxy_connect;proxy_connect_connect_timeout 10s;proxy_connect_read_timeout 10s;# 代理所有其他請求location / {proxy_pass http://$http_host$request_uri;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;# 忽略證書驗證proxy_ssl_verify off;}}
}
- 重新加載Nginx配置:
修改配置文件后,重新加載Nginx:
nginx -s reload
- 通過代理下載文件:
使用curl
命令通過代理測試下載flv
文件:
curl -x http://localhost:8888 -k https://220.181.49.193:10010/sms/11011200002020000001/flv/hls/11010000021321001788_11010000021321001788.flv -o test.mp4
或者使用ffmpeg
通過代理下載文件:
./ffmpeg-linux-amd64 -http_proxy http://localhost:8888 -i https://220.181.49.193:10010/sms/11011200002020000001/flv/hls/11010000021321001788_11010000021321001788.flv test.mp4
通過這些設置,curl
和Nginx都會忽略SSL證書檢查,從而避免證書驗證錯誤。