gpt4 book ai didi

windows - Chrome (v71) ERR_CONNECTION_RESET 在 Windows 8 Embedded 上的自签名本地主机上

转载 作者:太空宇宙 更新时间:2023-11-03 14:29:23 25 4
gpt4 key购买 nike

我在本地机器上运行 WCF 服务公开 API (https://localhost:8080/MyApi),在本地机器上注册自签名 SHA-256 证书,执行“netsh http add sslcert ipport=0.0.0.0:8080 certhash=... appid=...”,当浏览到 https://localhost:8080/MyApi 时从 Chrome 中显示 ERR_CONNECTION_RESET。

现在是有趣的部分:

  1. 适用于 Chrome v41。仅在升级到 Chrome v69 后发生(在 v71 上也是如此)。
  2. 从 IE 浏览效果很好。
  3. 也可以从 PowerShell web-invoke 调用 API。
  4. 在 Windows 10 上同样一切正常。
  5. 将#allow-insecure-localhost 修改为 ENABLED 适用于 Windows 10,但不适用于 Windows 8 Embedded。

激活 chrome 日志记录后发现:

{"params":{"net_error":-101,"os_error":10054},"phase":0,"source":{"id":7810,"type":8},"time":"52598608","type":68},
{"params":{"error_lib":33,"error_reason":101,"file":"../../net/socket/socket_bio_adapter.cc","line":154,"net_error":-101,"ssl_error":1},"phase":0,"source":{"id":7810,"type":8},"time":"52598608","type":54},

额外的 Chrome 日志记录:

[8652:5036:0107/174231.775:ERROR:ssl_client_socket_impl.cc(1013)] handshake failed; returned -1, SSL error code 1, net_error -101 [8652:5036:0107/174231.793:ERROR:ssl_client_socket_impl.cc(1013)] handshake fail ed; returned -1, SSL error code 1, net_error -101 [8652:5036:0107/174231.795:ERROR:ssl_client_socket_impl.cc(1013)] handshake fail ed; returned -1, SSL error code 1, net_error -101

您知道如何让 Chrome 成功访问我的 WCF 本地主机服务器吗?

最佳答案

您如何发布您的 wcf 服务?我希望您可以发布有关您的服务的更多详细信息。我按照您的步骤操作,但无法重现您的问题。这是我的demo,希望对你有用。
服务器(控制台应用,IP:10.157.13.69)。

class Program
{
static void Main(string[] args)
{
using (ServiceHost sh = new ServiceHost(typeof(MyService)))
{

sh.Opened += delegate
{
Console.WriteLine("service is ready...");
};
sh.Closed += delegate
{
Console.WriteLine("Service is closed");
};
sh.Open();
Console.ReadLine();
sh.Close();
}
}
}
[ServiceContract]
public interface IService
{
[OperationContract]
[WebGet]
string SayHello();
}
public class MyService : IService
{
public string SayHello()
{
return $"Hello, busy world\n{DateTime.Now.ToShortTimeString()}";
}
}

app.config

<system.serviceModel>
<services>
<service name="Server6.MyService" behaviorConfiguration="mybeh">
<endpoint address="" binding="webHttpBinding" contract="Server6.IService" behaviorConfiguration="rest" bindingConfiguration="mybinding" >
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"></endpoint>
<host>
<baseAddresses>
<add baseAddress="https://localhost:13060"/>
</baseAddresses>
</host>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="mybinding">
<security mode="Transport">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="mybeh">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"></serviceMetadata>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="rest">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>

将证书绑定(bind)到ip端口

netsh http add sslcert ipport=0.0.0.0:13060
certhash=6e48c590717cb2c61da97346d5901b260e983850 appid={AA228B95-6613-4D58-9236-2C263AFDF231}

结果这些浏览器版本都是V71.0
本地。
enter image description here
远程机器。
enter image description here
浏览器。
enter image description here

如果有什么我可以帮忙的,请随时告诉我。

关于windows - Chrome (v71) ERR_CONNECTION_RESET 在 Windows 8 Embedded 上的自签名本地主机上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54091805/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com