busybox icon indicating copy to clipboard operation
busybox copied to clipboard

TLS support

Open frafra opened this issue 7 years ago • 4 comments

wget cannot fetch data from HTTPS websites.

wget: note: TLS certificate validation not implemented
wget: TLS error from peer (alert code 40): handshake failure
wget: error getting response: Connection reset by peer

frafra avatar Jul 01 '19 10:07 frafra

The notice note: TLS certificate validation not implemented isn't an error in itself, so the . . . handshake failure is the actual error. Perhaps you're getting redirected to a non https server?

$ docker run -it --rm busybox sh

# wget https://github.com/docker-library/busybox/archive/master
.zip
Connecting to github.com (192.30.253.112:443)
wget: note: TLS certificate validation not implemented
Connecting to codeload.github.com (192.30.253.121:443)
saving to 'master.zip'
master.zip           100% |*****************| 12795  0:00:00 ETA
'master.zip' saved

# unzip master.zip 
Archive:  master.zip
   creating: busybox-master/
  inflating: busybox-master/.travis.yml
  inflating: busybox-master/README.md

# wget https://www.google.com
Connecting to www.google.com (172.217.11.68:443)
wget: note: TLS certificate validation not implemented
saving to 'index.html'
index.html           100% |*****************| 12225  0:00:00 ETA
'index.html' saved

# cat index.html | head -c 100
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"><head><meta content

wglambert avatar Jul 01 '19 16:07 wglambert

How can we get certificate validation here? Or is there simply no way to safely connect from a busybox image.

thisguycodes avatar Jul 10 '19 18:07 thisguycodes

My understanding is that it would require embedding a "full" SSL implementation such as OpenSSL in addition to somehow getting ca-certificates. I think users who need that are better off using a minimal distro like Alpine Linux which includes BusyBox with working SSL that has certificate verification out of the box (and is still ~4MB, so a very moderate increase over the size of this image, but also includes a full package manager).

tianon avatar Jul 10 '19 19:07 tianon

Assuming this is resolved, and since I can't reproduce an error with wget and https I'm going to close.

wglambert avatar Jul 29 '19 19:07 wglambert