在Alpine linux给只支持TLS1.0服务器发送https请求

发布于 2020-02-29 23:43:14

我正在Docker Alpine映像中编写一个简单的Web爬虫。但是,我无法将HTTPS请求发送到仅支持TLS1.0的服务器。如何配置Alpine Linux以允许过时的TLS版本?
我尝试添加 MinProtocol/etc/ssl/openssl.cnf里,但没起作用
Dockerfile:

FROM node:12.0-alpine

RUN printf "[system_default_sect]\nMinProtocol = TLSv1.0\nCipherString = DEFAULT@SECLEVEL=1" >> /etc/ssl/openssl.cnf

CMD ["/usr/bin/wget", "https://www.restauracesalanda.cz/"]

构建时报错:

Connecting to www.restauracesalanda.cz (93.185.102.124:443)
ssl_client: www.restauracesalanda.cz: handshake failed: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
wget: error getting response: Connection reset by peer

查看更多

关注者
0
被浏览
1.3k
1 个回答
蒂姆·威斯特伦
这家伙很懒,什么也没写!

使用builtin-busybox-wget地区是有问题的,你可以试试常规的wget

root@a:~# docker run --rm -it node:12.0-alpine /bin/ash
/ # wget -q https://www.restauracesalanda.cz/; echo $?
ssl_client: www.restauracesalanda.cz: handshake failed: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
wget: error getting response: Connection reset by peer
1
/ # apk add wget
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/1) Installing wget (1.20.3-r0)
Executing busybox-1.29.3-r10.trigger
OK: 7 MiB in 17 packages
/ # wget -q https://www.restauracesalanda.cz/; echo $?
0
/ #

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览