我想https://example.com使用该wget命令下载,但它显示“不受支持/无法识别的协议”。我尝试使用 ,--secure protocol=''但这不起作用。我从 GNU wget 下载了 tar 文件并尝试配置它,但我失败了。
这是我所看到的一个例子:
bash-2.05$ wget https://www.facebook.com/
https://www.facebook.com/: Unknown/unsupported protocol.
bash-2.05$
Run Code Online (Sandbox Code Playgroud)
大家好,感谢您的回答,验证了我的 wget 版本,如下所示
bash-2.05$ wget -V
GNU Wget 1.6
Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. …Run Code Online (Sandbox Code Playgroud) 我创建了以下端口转发:
ssh -vL localhost:4433:example.com:443 remote-linux-host
Run Code Online (Sandbox Code Playgroud)
注意:我在4433本地使用而不是443避免使用sudo.
但是,当我转到https://localhost:4433/,忽略证书检查后,出现以下错误(在 Chrome 和 Firefox 上):
404 - 未找到
使用时相同curl:
$ curl -s https://localhost:4433/ | html2text
<?xml version="1.0" encoding="iso-8859-1"?>
****** 404 - Not Found ******
Run Code Online (Sandbox Code Playgroud)
如何为 HTTPS 进行端口转发?
我的目标是https://example.com/通过远程服务器在我的本地(端口 4433)上打开(通过 HTTPS 正常工作)。
我想检查 https 服务是否同时监听 IPv6 和 IPv4。
而且当我通过浏览器访问 url 时,我想知道请求是由 IPv4 还是 IPv6 提供的。
我编写了这段代码来获取给定域的 SSL 证书中主题字段的通用名称:
$ echo -e "GET / HTTP/1.1\nEOT" | \
openssl s_client -connect google.com:443 2>&1 | \
grep subject
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com
Run Code Online (Sandbox Code Playgroud)
然而,这只给了我“主题”值。替代 CN 可能会列在“主题替代名称”字段中。例如:

那么,如何在 Bash 中获取主题备用名称字段的值?
在 Debian Wheezy 中,我的/etc/apt/sources.list文件如下所示:
deb https://mirrors.kernel.org/debian/ wheezy main contrib non-free
deb-src https://mirrors.kernel.org/debian/ wheezy main contrib non-free
deb http://security.debian.org/debian/ wheezy main contrib non-free
deb-src http://security.debian.org/debian/ wheezy main contrib non-free
deb https://mirrors.kernel.org/debian/ wheezy-updates main contrib non-free
deb-src https://mirrors.kernel.org/debian/ wheezy-updates main contrib non-free
Run Code Online (Sandbox Code Playgroud)
当我执行sudo apt-get update以下错误消息时出现:
E: The method driver /usr/lib/apt/methods/https could not be found
Run Code Online (Sandbox Code Playgroud)
它的修复方法是什么?
在我们公司,他们强制执行网络代理,该代理会中断 SSL 连接并用其自己的假证书替换证书。(准确地说,它使用由公司证书签名的代理证书。)
因此,为了从 https URL 下载,我必须让我的系统信任该假证书(或禁用证书检查)。
因此,我将代理证书和公司证书都添加到/etc/ssl/certs/ca-bundle.crt和中/etc/ssl/certs/ca-certificates.crt。(两者都链接到同一个文件。)
现在使用下载wget工作正常,但是使用下载curl不起作用,因为curl无法验证证书:
* Rebuilt URL to: https://company.net/
* Hostname was NOT found in DNS cache
* Trying 172.18.111.111...
* Connected to 172.18.111.111 (172.18.111.111) port 3128 (#0)
* Establish HTTP proxy tunnel to company.net:443
> CONNECT company.net:443 HTTP/1.1
> Host: company.net:443
> User-Agent: curl/7.39.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied OK to CONNECT request
* successfully set …Run Code Online (Sandbox Code Playgroud) 我正在尝试递归下载通常仅在您登录时可用的网站。
我有有效的用户名和密码,但问题是我需要通过 Web 界面登录,所以使用--user=user and --password=password无济于事。
wget只下载一个带有文字的网页:
抱歉,此页面不可用,也许您忘记登录了?
可以下载吗?
我不能使用 --user, --password 即使在登录页面,因为没有提到的 FTP/HTTP 文件检索登录man wget:
--user=user
--password=password
Specify the username user and password password for both FTP and
HTTP file retrieval.
Run Code Online (Sandbox Code Playgroud)
经典的图形登录就在那里。
如果我尝试这样做:wget --save-cookies coookies --keep-session-cookies --post-data='j_username=usr&j_password=pwd' 'https://idp2.civ.cvut.cz/idp/Authn/UserPassword'。使用POST方式登录并尝试保存cookies,cookies文件为空,保存页面为错误页面。
网址是https://idp2.civ.cvut.cz/idp/Authn/UserPassword。实际上,当我想登录时,它会将我重定向到此页面,当我成功登录时,它会将我重定向回我之前所在的页面或登录后我想进入的某个页面(例如:https://progtest.fit.cvut.cz/.
我正在尝试为 3 个 Web 服务器创建代理(与代理在同一台计算机上运行)。A 已成功配置中继以通过其主机标头将请求重定向到正确的端口,但我无法根据请求主机标头设置自定义证书和私钥文件,因此所有域都会获得保存在 /etc/ssl/IP_ADDRESS 中的相同密钥和证书对.crt 和 /etc/ssl/private/IP_ADDRESS.key。您对如何实现这一目标有什么想法吗?
我的/etc/realyd.conf:
domain1="bar.com"
port1="3000"
domain2="foo.com"
port2="8000"
challengeport="3001"
table <challenge> { 127.0.0.1 }
table <table1> { 127.0.0.1 }
table <table2> {127.0.0.1 }
http protocol filter_challenge {
pass request path "/.well-known/acme-challenge/*" forward to <challenge>
tcp { nodelay, sack }
}
http protocol resolve_domains {
pass request quick header "Host" value $domain1 forward to <table1>
pass request quick header "Host" value $domain2 forward to <table2>
tcp { nodelay, sack }
}
relay …Run Code Online (Sandbox Code Playgroud) 目的:通过命令行直接下载官方Win10_1909 iso到linux
来源:https : //www.microsoft.com/en-in/software-download/windows10ISO
选择版本和语言后得到如下64位链接,24小时有效
这通过任何 gui 浏览器或任何平台都可以正常工作,但我们需要在 linux box 中使用它
如何仅通过命令行完成此操作?
我在使用 cURL 或 wget 连接到 https 站点时遇到问题。当我从 https 下载时,curl 在执行 TLS 握手时似乎卡住了,CERT。问题与站点无关(我注意到它使用 github)并且 wget 也挂了(尽管我没有查看那里的详细输出)。
$ curl -v --trace-time https://www.google.de
10:35:21.532822 * About to connect() to www.google.de port 443 (#0)
10:35:21.533091 * Trying 209.85.148.147... connected
10:35:21.538666 * Connected to www.google.de (209.85.148.147) port 443 (#0)
10:35:21.539119 * SSLv3, TLS handshake, Client hello (1):
10:35:21.544129 * SSLv3, TLS handshake, Server hello (2):
10:35:21.544182 * SSLv3, TLS handshake, CERT (11):
Run Code Online (Sandbox Code Playgroud)
我已经等了 10 分钟以上,但没有任何反应。我正在使用 OSX Lion。
$curl --version
curl 7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 …Run Code Online (Sandbox Code Playgroud)