- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
有没有人找到一种方法来强制 Powershell TLS 客户端不使用 SNI,或者在服务器出现 SNI 错误后继续连接?
我正在尝试让一个 powershell 脚本从我们的 DHCP 服务器下载一个大的网络列表,并将其格式化以导入到另一个系统。
我可以使用浏览器下载数据 - 观察与 Wireshark 的连接,我看到浏览器开始 TLS 握手,发送 SNI 指示,服务器响应“TLS 警报(级别:警告,描述:无法识别的名称) ",浏览器继续使用 TLS 连接,下载成功。
为了调试请求,我通过本地代理(burp 套件,它是一个 Java 应用程序)运行连接,因此我可以看到加密隧道和 HTTP 请求的内容。这导致连接失败并且代理立即返回错误。显然,Java TLS 代码不愿意继续连接浏览器从容应对的 TLS 错误。如果我强制代理不在请求中包含服务器名称标识 (SNI),它会起作用(请参阅下面注释掉的调试代码)。
最后,从混合中删除代理,似乎 Powershell 使用的网络代码也不愿意继续过去的错误 - 它发送相同的 SNI 指示符,接收相同的 TLS 错误,然后挂起 - 不再有数据包交换直到 100 秒过去,然后连接用 FIN 数据包关闭,Powershells 返回超时错误:
使用“2”个参数调用“DownloadFile”时出现异常:“操作已超时”
我使用的代码是这样的:
$webclient = new-object System.Net.WebClient
#DEBUG for now - send requests through proxy
#$proxy = new-object System.Net.WebProxy
#$proxy.Address = "http://localhost:8080"
#$webclient.proxy = $proxy
# have to do this to ignore invalid certs from proxy
#[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
#Also have to force the JRE running the proxy to not send SNI in the request - invoke as
#java -Djsse.enableSNIExtension=false -jar c:\Users\MarkS\Burp\burpsuite_pro_v1.6.09.jar
#end DEBUG
$server = $(
$input = Read-Host "server to connect to [our-DHCP-server-name]"
if($input) {$input} else {"our-DHCP-server-name"}
)
$current_id = [Environment]::Username
$user_id = $(
$input = Read-Host "user ID to connect as [$current_id]"
if($input) {$input} else {$current_id}
)
$password = Read-Host -AsSecureString 'password to connect with'
$pscreds = new-object System.Management.Automation.PSCredential($user_id,$password)
$webclient.Credentials = new-object System.Net.NetworkCredential($user_id, $pscreds.GetNetworkCredential().Password)
#connect...
$tempfile = [System.IO.Path]::GetTempFileName()
$tempfile
#...and download
#NOTE - don't use XML - server returns badly malformed XML
$url = "https://$server/wapi/v1.2.1/network?_max_results=10000000&_return_type=json-pretty&_return_fields%2B=extattrs"
$webclient.DownloadFile($url, $tempfile)
非常感谢!
最佳答案
我有一个解决方案。更多的解决方法恰好对我有用;它仍然不是通用解决方案。
添加:
[System.Net.ServicePointManager]::SecurityProtocol = 'Ssl3'
在连接尝试之前将强制客户端仅使用 SSLv3(此服务器配置为支持),这会阻止 SNI 发挥作用,因为它是一个仅限 TLS 的功能。
当然,这对尝试连接到仅支持 TLS 的服务器的任何人都没有帮助,而且只要我们的服务器仍然支持 SSLv3,它只会对我有帮助...
关于Powershell WebClient 放弃遇到 SNI 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27449975/
我正在为驻留在同一台服务器上的不同域设置多个不同的 SSL 证书(因此共享相同的 IP 地址)。 与 Qualys SSL Test我发现有些客户端(即 BingBot as of december
我们想在连接到各种外部端点 (SOAP/REST) 的 PHP 客户端中启用 SNI(服务器名称指示)。其中一些端点支持 SNI 作为服务器,但有些不支持。在所有传出请求上启用 SNI 会导致不支持
浏览器是当前的 Chrome 或 FF。在服务器 apache 2.2ish 上。 我启用了许多 SNI 站点 - 虚拟主机 *.443 等。所有单独的配置文件。一切正常。 如果我在浏览器中导航到这些
AWS 网络负载均衡器 support TLS termination .这意味着可以在 AWS Certificate Manager 中创建证书并将其安装到 NLB,然后使用 TLS 加密的 TC
我正在尝试验证 TLS 客户端是否检查服务器名称指示 (SNI)。 我首先尝试使用 openssl 重现这些步骤。 我试图用这个 openssl 命令连接到谷歌 openssl version ope
我知道 Tomcat 提供 SNI 和相互身份验证,但是否可以只为选定的应用程序/路径启用 MA? IE。假设我的服务器上有以下应用程序/端点: /app1 /app2/human /app2/rob
如何使用 C 或 C++ 在 OpenSSL 上实现服务器名称指示 (SNI)? 是否有任何现实世界的例子可用? 最佳答案 在客户端,您使用 SSL_set_tlsext_host_name(ssl,
在我们的系统中,虚拟主机配置存储在redis中。在连接设置期间,当收到 SNI 时,我们想查询 redis 以获取用于 TLS 连接的正确证书和 key 对,并创建一个附加的新 Context 实例。
我在使用 Apache HttpClient (4.5.2) 的 Java 8 上遇到此错误: javax.net.ssl.SSLProtocolException:握手警报:unrecognized
我有一个 Web 服务 (asmx) API,它是由我管理的另一位开发人员用 .NET 3.5 编写的。我们最近从 Server 2008R2 迁移到 Server 2012R2,我决定使用 SNI
我们托管了数十万个域。我们希望在单个 I.P. 上为所有这些提供 SSL/TLS。显然,SNI允许我们这样做。但是,这表明我们的 SSL 终止服务器上实际上有成千上万个证书。 对于可以安装在 SNI
有没有办法在现代浏览器中暂时禁用 SNI? 例如测试老客户的网站可用性。 (自从 POODLE 以来,人们应该担心他们吗?) 最佳答案 可能测试老客户可用性的最佳方法是实际试用老客户。 Microso
我在这里拉扯我的头发。像 wix.com 这样的网站, squarespace.com ...ETC;可以即时生成网站,并且仍然在数百万自定义域中的每一个上使用 SSL。 我尝试做同样的事情,但我不知
我可以找到有关 SNI 的各种信息(请参阅 Wikipedia ),但我找不到有关浏览器实际支持的任何统计信息。 我能找到的最好的结果是它应该可以在带有 SP3 的 Windows XP 上运行。 有
Java 7 带来了 client support for SNI .是否有已知的 SNI 服务器角色的开源实现? Java 提供“透明支持”TLS 连接(包括握手),但我需要解耦握手过程,以便我可以
如何使用 C 或 C++ 在 OpenSSL 上实现服务器名称指示 (SNI)? 是否有任何现实世界的例子可用? 最佳答案 在客户端,您使用 SSL_set_tlsext_host_name(ssl,
我遇到了一个我不理解的 Java SNI SSL 行为。在 Java 中使用 SNI 时,我希望 Google 不会为无效的主机名提供任何证书,但它确实提供了。 KeyStore keystore =
我有一个站点,其中有由 letsencrypt 创建的 ssl,但是没有 sni ssl 存在问题。它配置好吗? https://www.ssllabs.com/ssltest/analyze.htm
Java 6 可以使用 TLS + SNI 吗? TLS 与 java 6 配合得很好,但似乎不支持 SNI。 Java 7 及更高版本可以正常工作。但我坚持使用 Java 6。 Java 6 adv
我已经使用 SNI 在我的网站上实现了 SSL。现在我知道旧浏览器不支持 SNI 功能。我要问的是,当用户尝试使用不支持 SNI 的浏览器访问我的网站时,是否可以将用户重定向到其他登录页面。 请建议我
我是一名优秀的程序员,十分优秀!