- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
设置是我在同一个 HTTPS 网站上使用相同的应用程序池和证书托管 2 个类似的 WCF 应用程序。
现在第一个 WCF 应用程序在某个函数上调用第二个 WCF。在第一次调用第二个 WCF 后,抛出异常
"Could not establish trust relationship for the SSL/TLS secure channel..."
我见过类似的问题,但不同之处在于我的问题应该有效,因为它使用的是相同的证书。可能发生了什么?
编辑:
基本上这是在第一个 WCF 的方法内调用第二个 WCF 的方式,
public void SomeMethod(string parameter)
{
SecondServiceClient svc2 = new SecondServiceClient ("BasicHttpBinding_IService2");
svc2.DoWork(parameter);
}
第二个 WCF 的第一个 WCF 的 web.config 端点是这样的:
...
<client>
<endpoint address="https://192.168.1.100/MyService2/Service2.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService2"
contract="SecondService.IService" name="BasicHttpBinding_IService" />
</client>
...
HTTPS 很难玩,我说。
最佳答案
访问 HTTPS 网站的客户端需要验证有关其证书的两件事:
PKI 验证通过配置客户端设置信任 anchor (受信任的 CA 证书)来解决。如果您的证书是由操作系统默认信任的 CA 颁发的,则您不需要执行任何操作。如果您必须自己安装 CA 证书,请确保它也在机器的商店(不仅仅是用户的商店)中启用,因为您的应用程序可能作为服务运行(而不是在特定用户)。
身份验证依赖于您尝试联系的身份(主机名或 IP 地址)以及证书颁发给的身份。他们必须匹配。规则在RFC 2818 Section 3.1 ,特别是:
If a subjectAltName extension of type dNSName is present, that MUSTbe used as the identity. Otherwise, the (most specific) Common Namefield in the Subject field of the certificate MUST be used. Althoughthe use of the Common Name is existing practice, it is deprecated andCertification Authorities are encouraged to use the dNSName instead.
[...]
In some cases, the URI is specified as an IP address rather than ahostname. In this case, the iPAddress subjectAltName must be presentin the certificate and must exactly match the IP in the URI.
您的服务器可能在内部响应多个主机名和 IP 地址,例如 www.example.com
、192.168.1.100
、localhost
,127.0.0.1
。您的证书必须对您尝试与之联系的主机/IP 地址有效。
将证书颁发给 localhost
或 127.0.0.1
几乎没有意义,所以我怀疑你拥有的是什么,并且没有必要配置你的客户端 https://localhost/...
因为这个原因。
192.168.1.100
的证书是可能的,但它必须有此 IP 地址的 IP(不是 DNS)主题备用名称条目。 (考虑到这是一个私有(private)地址,这种情况不太可能发生。)
您可能需要将您的服务配置为使用可见的主机名(您的证书可能为其颁发的主机名):www.example.com
(或其他名称)。如果您在反向 NAT 后面托管此服务,则可能会出现问题。
关于WCF : Could not establish trust relationship for the SSL/TLS secure channel for localhost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8852754/
经过一个月的 docker trust 通过 GitLab CI 为我工作正常后,我突然收到了这条消息。 我有一个 Gitlab Runner 挂载 ~/.docker/trust (所以它被持久化)
我在 Ken Thompson 的一篇文章(阅读 here)中看到的这个 quine 没有重现相同的代码。我只是好奇为什么它不起作用?代码现在过时了吗? quine代码: char s[] = {
我们的一个网络应用程序想要连接ADFS 2.0服务器以获取凭据 token 并据此检查用户角色。 ADFS 服务器管理员要求我们向他们提供联合元数据 XML 文件,以便他们创建依赖方信任。我用谷歌搜索
我正在实现一个必须支持 WS-Trust (1.3) 的网络服务。 OASIS 将 WS-Trust 的命名空间定义为 http://docs.oasis-open.org/ws-sx/ws-trus
我正在尝试确保我的 ASP.Net 库能够在 Medium Trust 下运行。但是,我遇到了问题,如果它在中等信任下运行,我需要禁用一些代码。 如何从 C# 确定当前应用程序是否为中等信任度? 具体
假设您已使用 Google 2-step Verification 注册您的设备,当您返回网站时,它使用什么信息来验证您是否在该设备上? 它是否在您的计算机上存储了一些东西(如 cookie),还是使
我不仅尝试从通用的用户代理字符串中提取浏览器及其版本号,而且还提取呈现引擎及其版本号。大多数浏览器都报告这很好,例如: “Mozilla/4.0(兼容; MSIE 8.0; Windows NT 6.
运行 ANT 脚本目标时出现以下错误。错误消息显示“服务器证书验证失败”。请帮助如何消除这个问题。我在 Windows XP 中工作。 C:\apache-ant-1.8.1>ant checkout
来自ConcurrentHashMap的文档: A hash table supporting full concurrency of retrievals and adjustable expect
来自ConcurrentHashMap的文档: A hash table supporting full concurrency of retrievals and adjustable expect
我正在为我的组织使用 Tomcat 7、APR 和 DigiCert 签名的“星号”证书。我有一个定义如下的连接器: IE 和 Chrome 对我的站点/证书没有问题...虽然 Firefox 给出
我有包含 Symantec 的信任库。我正在尝试连接到由 VeriSign 签名的服务器。我在握手期间收到 ssl“未找到受信任的证书”。可能是因为我在信任库中没有 VeriSign CA? 我正在使
我想问一下Medium Trust允许哪些方法/类。例如,这些方法是否被允许? 获取属性,获取方法,激活器.CreateInstance,程序集版本,程序集名称.名称 请告诉我哪些方法是允许的。 最佳
我希望这里的大型社区中的任何人都可以帮助我编写我可以扩展的最简单的“可信”程序。 我使用的是 Ubuntu Linux 9.04,以及来自 Mario Strasser (http://tpm-emu
我正在尝试安装 Docker Truster Registry (DTR)。我正在执行以下命令: docker run -it --rm \ docker/dtr install \ --ucp-ur
[ 编辑 :我写了一篇博文,详细解释了一切:look here ] 你好! 我正在拼命尝试为基于 rfc3161 的可信时间戳构建服务。我决定使用 zeitstempel.dfn.de 上的免费可信时
终于得到了 MGTwitterEngine 的东西 编译(通过将 header 搜索路径设置为/usr/include/libxml2 iphoneos3.0/usr/lib/libxml2) 和链接
我还没有在一页中清楚地看到这一点:部分受信任的调用者。 我正在研究 APTCA,这总是被提及,但 MSDN 没有关于它的文章。 我只有一些线索,但我不是 100% 确定。 从网络共享执行的代码是否符合
我已将DTR安装在单个管理器, worker 群集上(在设置适当的环境之前先玩弄它以获得更好的理解) DTR安装成功。我想卸载DTR,并且卸载它没有任何问题。以下命令用于基于文档的卸载 Activit
我正在尝试设置 docker,以便它与修改后的公证人版本一起使用,从我的 HSM 中提取私钥。 为此,我正在使用公证人的这个 fork : https://github.com/gemalto/not
我是一名优秀的程序员,十分优秀!