Hi Everyone, I'm using Wget 1.21 to download the HSTS data file from https://gitlab.com/rockdaboot/libhsts. It looks like:
if ! wget --debug -O hsts.json --ca-certificate=cacert.pem \ 'https://raw.github.com/chromium/chromium/master/net/http/transport_security_state_static.json' then echo "Failed to download hsts.json" exit 1 fi The file downloads, but Wget returns 1. I'm not sure what is failing. ls shows data in hsts.json, and --debug does not show a problem. Any ideas what might be wrong? Thanks in advance. Jeff ========== Here is output from wget --debug: Setting --output-document (outputdocument) to hsts.json Setting --ca-certificate (cacertificate) to /home/jwalton/.build-scripts/cacert/github-ca-zoo.pem DEBUG output created by Wget 1.21.1 on linux-gnu. Reading HSTS entries from /home/jwalton/.wget-hsts --2021-01-17 04:57:40-- http://libhsts-0.1.0.tar.gz/ Resolving libhsts-0.1.0.tar.gz... failed: Name or service not known. wget: unable to resolve host address 'libhsts-0.1.0.tar.gz' --2021-01-17 04:57:40-- https://raw.github.com/chromium/chromium/master/net/http/transport_security_state_static.json Resolving raw.github.com... 151.101.208.133 Caching raw.github.com => 151.101.208.133 Connecting to raw.github.com|151.101.208.133|:443... connected. Created socket 4. Releasing 0x0000563a444c3530 (new refcount 1). Initiating SSL handshake. Handshake successful; connected socket 4 to SSL handle 0x0000563a444c10c0 certificate: subject: CN=www.github.com,O=GitHub\\, Inc.,L=San Francisco,ST=California,C=US issuer: CN=DigiCert SHA2 High Assurance Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US X509 certificate successfully verified and matches host raw.github.com ---request begin--- GET /chromium/chromium/master/net/http/transport_security_state_static.json HTTP/1.1 User-Agent: Wget/1.21.1 Accept: */* Accept-Encoding: identity Host: raw.github.com Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 301 Moved Permanently Connection: keep-alive Content-Length: 0 Location: https://raw.githubusercontent.com/chromium/chromium/master/net/http/transport_security_state_static.json Accept-Ranges: bytes Date: Sun, 17 Jan 2021 09:57:40 GMT Via: 1.1 varnish Age: 0 X-Served-By: cache-ewr18122-EWR X-Cache: MISS X-Cache-Hits: 0 Vary: Accept-Encoding X-Fastly-Request-ID: b7d16eac0d4d01064ed3d77024c35c3cc43c8d4b ---response end--- 301 Moved Permanently Registered socket 4 for persistent reuse. Location: https://raw.githubusercontent.com/chromium/chromium/master/net/http/transport_security_state_static.json [following] ] done. --2021-01-17 04:57:40-- https://raw.githubusercontent.com/chromium/chromium/master/net/http/transport_security_state_static.json Resolving raw.githubusercontent.com... 151.101.208.133 Caching raw.githubusercontent.com => 151.101.208.133 Connecting to raw.githubusercontent.com|151.101.208.133|:443... connected. Created socket 5. Releasing 0x0000563a444d3f30 (new refcount 1). Initiating SSL handshake. Handshake successful; connected socket 5 to SSL handle 0x0000563a444d1fc0 certificate: subject: CN=www.github.com,O=GitHub\\, Inc.,L=San Francisco,ST=California,C=US issuer: CN=DigiCert SHA2 High Assurance Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US X509 certificate successfully verified and matches host raw.githubusercontent.com ---request begin--- GET /chromium/chromium/master/net/http/transport_security_state_static.json HTTP/1.1 User-Agent: Wget/1.21.1 Accept: */* Accept-Encoding: identity Host: raw.githubusercontent.com Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 200 OK Connection: keep-alive Content-Length: 14124436 Cache-Control: max-age=300 Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox Content-Type: text/plain; charset=utf-8 ETag: "979ae28b92411e9ffeaad0d801873fe4d362f5d85eb761f13f11ea63d1de614d" Strict-Transport-Security: max-age=31536000 X-Content-Type-Options: nosniff X-Frame-Options: deny X-XSS-Protection: 1; mode=block via: 1.1 varnish (Varnish/6.0), 1.1 varnish X-GitHub-Request-Id: 1192:785A:66AF94:706910:600409DC Accept-Ranges: bytes Date: Sun, 17 Jan 2021 09:57:41 GMT X-Served-By: cache-ewr18151-EWR X-Cache: MISS, HIT X-Cache-Hits: 0, 0 X-Timer: S1610877461.043534,VS0,VE0 Vary: Authorization,Accept-Encoding Access-Control-Allow-Origin: * X-Fastly-Request-ID: 2ecb3bbf010212d286e50be43ddd38a7c8383b2d Expires: Sun, 17 Jan 2021 10:02:41 GMT Source-Age: 57 ---response end--- 200 OK Disabling further reuse of socket 4. Closed 4/SSL 0x0000563a444c10c0 Registered socket 5 for persistent reuse. Parsed Strict-Transport-Security max-age = 31536000, includeSubDomains = false Updated HSTS host: raw.githubusercontent.com:443 (max-age: 31536000, includeSubdomains: false) Length: 14124436 (13M) [text/plain] Saving to: 'hsts.json' hsts.json 100%[===================>] 13.47M 11.8MB/s in 1.1s 2021-01-17 04:57:42 (11.8 MB/s) - 'hsts.json' saved [14124436/14124436] FINISHED --2021-01-17 04:57:42-- Total wall clock time: 1.4s Downloaded: 1 files, 13M in 1.1s (11.8 MB/s) Saving HSTS entries to /home/jwalton/.wget-hsts $ echo "$?" 1
