BeyondDimension / SteamTools

🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。
https://steampp.net
GNU General Public License v3.0
20.28k stars 1.32k forks source link

👑[Enhancement] app修改hosts时候希望新增而不是覆盖 #894

Open 1078249029 opened 2 years ago

1078249029 commented 2 years ago

🥰 需求描述(Description)

我使用过加速服务后现在一些论坛网站都登不上去了,查了一圈发现hosts文件改了。现在github都连不上,我这里还是用手机提的issuse,所以希望修改host的方式是新增而不是覆盖

另外,我在使用加速器登录github时他提示我未建立安全连接,可能是github需要https?

🧐 解决方案(Solution)

修改host的方式变为新增

🚑 其他信息(Other Information)

IMG20220114150147

Mossimos commented 2 years ago

hosts如果有相同的会注释屏蔽然后追加 火狐需要手动导入证书信任一下

https://steampp.net/faq#CommunityAccelerate

AigioL commented 2 years ago

目前更改 hosts 时会将之前存在相同域名的纪录注释,在停止加速后会还原。

例如 abcd.com 加速前

xxx.yyy.xxx.yyy abcd.com

加速后会变成

# Steam++ Start
127.0.0.1 abcd.com
# Steam++ End

# Steam++ Backup Start
#23 xxx.yyy.xxx.yyy abcd.com
# Steam++ Backup End

如果有覆盖的情况,可以将原 hosts 数据发一份测试一下

1078249029 commented 2 years ago

目前更改 hosts 时会将之前存在相同域名的纪录注释,在停止加速后会还原。

例如 abcd.com 加速前

xxx.yyy.xxx.yyy abcd.com

加速后会变成

# Steam++ Start
127.0.0.1 abcd.com
# Steam++ End

# Steam++ Backup Start
#23 xxx.yyy.xxx.yyy abcd.com
# Steam++ Backup End

如果有覆盖的情况,可以将原 hosts 数据发一份测试一下

原数据已丢失,并且接下来多次加速并未出现host被覆盖问题 我所记起的host原数据是

18.139.201.98 docs.rsshub.app 172.64.137.26 www.sayhuahuo.com 104.26.8.23 bgm.tv 还有网友分享的github,pixiv,northplus的ip,这个实在找不到了

现在更重要的问题是每次电脑关机重启后需要移除证书再重新导入并需要手动安装一下或者开机后开steam++挂机10分钟左右,否则firefox进入代理网站还会报错。日志如下

2022-01-21 13:28:30.2890|Error|SteamworksLocalApiS|Initialize Fail. | SAM.API.ClientInitializeException: failed to create pipe at SAM.API.Client.Initialize(Int64 appId) at System.Application.Services.Implementation.SteamworksLocalApiServiceImpl.Initialize() 2022-01-21 13:28:44.3160|Error|HttpProxyS|ProxyServer ExceptionFunc | Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: 不支持请求的操作。 at System.Security.Cryptography.CngKey.Export(CngKeyBlobFormat format) at System.Security.Cryptography.RSACng.ExportKeyBlob(Boolean includePrivateParameters) at System.Security.Cryptography.RSACng.ExportParameters(Boolean includePrivateParameters) at Org.BouncyCastle.Security.DotNetUtilities.GetRsaKeyPair(RSA rsa) in //crypto/src/security/DotNetUtilities.cs:line 100 at Org.BouncyCastle.Security.DotNetUtilities.GetKeyPair(AsymmetricAlgorithm privateKey) in //crypto/src/security/DotNetUtilities.cs:line 149 at Titanium.Web.Proxy.Network.Certificate.BCCertificateMaker.makeCertificateInternal(String hostName, String subjectName, DateTime validFrom, DateTime validTo, X509Certificate2 signingCertificate) at Titanium.Web.Proxy.Network.Certificate.BCCertificateMaker.makeCertificateInternal(String subject, Boolean switchToMtaIfNeeded, X509Certificate2 signingCert) at Titanium.Web.Proxy.Network.Certificate.BCCertificateMaker.MakeCertificate(String sSubjectCn, X509Certificate2 signingCert) at Titanium.Web.Proxy.Network.CertificateManager.makeCertificate(String certificateName, Boolean isRootCertificate) at Titanium.Web.Proxy.Network.CertificateManager.CreateCertificate(String certificateName, Boolean isRootCertificate) 2022-01-21 13:28:44.3360|Error|HttpProxyS|ProxyServer ExceptionFunc | Titanium.Web.Proxy.Exceptions.ProxyConnectException: Couldn't authenticate host 'github.com' with certificate ''. ---> System.ArgumentNullException: Value cannot be null. (Parameter 'ServerCertificate') at System.Net.Security.SslStream.CreateAuthenticationOptions(SslServerAuthenticationOptions sslServerAuthenticationOptions) at System.Net.Security.SslStream.AuthenticateAsServerAsync(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken) at System.Net.Security.SslStream.AuthenticateAsServerAsync(X509Certificate serverCertificate, Boolean clientCertificateRequired, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation) at Titanium.Web.Proxy.ProxyServer.handleClient(TransparentBaseProxyEndPoint endPoint, TcpClientConnection clientConnection, Int32 port, CancellationTokenSource cancellationTokenSource, CancellationToken cancellationToken) --- End of inner exception stack trace --- at Titanium.Web.Proxy.ProxyServer.handleClient(TransparentBaseProxyEndPoint endPoint, TcpClientConnection clientConnection, Int32 port, CancellationTokenSource cancellationTokenSource, CancellationToken cancellationToken) 2022-01-21 13:28:44.3360|Error|HttpProxyS|ProxyServer ExceptionFunc | Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: 不支持请求的操作。 at System.Security.Cryptography.CngKey.Export(CngKeyBlobFormat format) at System.Security.Cryptography.RSACng.ExportKeyBlob(Boolean includePrivateParameters) at System.Security.Cryptography.RSACng.ExportParameters(Boolean includePrivateParameters) at Org.BouncyCastle.Security.DotNetUtilities.GetRsaKeyPair(RSA rsa) in //crypto/src/security/DotNetUtilities.cs:line 100 at Org.BouncyCastle.Security.DotNetUtilities.GetKeyPair(AsymmetricAlgorithm privateKey) in //crypto/src/security/DotNetUtilities.cs:line 149 at Titanium.Web.Proxy.Network.Certificate.BCCertificateMaker.makeCertificateInternal(String hostName, String subjectName, DateTime validFrom, DateTime validTo, X509Certificate2 signingCertificate) at Titanium.Web.Proxy.Network.Certificate.BCCertificateMaker.makeCertificateInternal(String subject, Boolean switchToMtaIfNeeded, X509Certificate2 signingCert) at Titanium.Web.Proxy.Network.Certificate.BCCertificateMaker.MakeCertificate(String sSubjectCn, X509Certificate2 signingCert) at Titanium.Web.Proxy.Network.CertificateManager.makeCertificate(String certificateName, Boolean isRootCertificate) at Titanium.Web.Proxy.Network.CertificateManager.CreateCertificate(String certificateName, Boolean isRootCertificate) 2022-01-21 13:28:44.3360|Error|HttpProxyS|ProxyServer ExceptionFunc | Titanium.Web.Proxy.Exceptions.ProxyConnectException: Couldn't authenticate host 'github.com' with certificate ''. ---> System.ArgumentNullException: Value cannot be null. (Parameter 'ServerCertificate') at System.Net.Security.SslStream.CreateAuthenticationOptions(SslServerAuthenticationOptions sslServerAuthenticationOptions) at System.Net.Security.SslStream.AuthenticateAsServerAsync(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken) at System.Net.Security.SslStream.AuthenticateAsServerAsync(X509Certificate serverCertificate, Boolean clientCertificateRequired, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation) at Titanium.Web.Proxy.ProxyServer.handleClient(TransparentBaseProxyEndPoint endPoint, TcpClientConnection clientConnection, Int32 port, CancellationTokenSource cancellationTokenSource, CancellationToken cancellationToken) --- End of inner exception stack trace --- at Titanium.Web.Proxy.ProxyServer.handleClient(TransparentBaseProxyEndPoint endPoint, TcpClientConnection clientConnection, Int32 port, CancellationTokenSource cancellationTokenSource, CancellationToken cancellationToken) 2022-01-21 13:28:50.1770|Error|HttpProxyS|ProxyServer ExceptionFunc | Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: 不支持请求的操作。 at System.Security.Cryptography.CngKey.Export(CngKeyBlobFormat format) at System.Security.Cryptography.RSACng.ExportKeyBlob(Boolean includePrivateParameters) at System.Security.Cryptography.RSACng.ExportParameters(Boolean includePrivateParameters) at Org.BouncyCastle.Security.DotNetUtilities.GetRsaKeyPair(RSA rsa) in //crypto/src/security/DotNetUtilities.cs:line 100 at Org.BouncyCastle.Security.DotNetUtilities.GetKeyPair(AsymmetricAlgorithm privateKey) in //crypto/src/security/DotNetUtilities.cs:line 149 at Titanium.Web.Proxy.Network.Certificate.BCCertificateMaker.makeCertificateInternal(String hostName, String subjectName, DateTime validFrom, DateTime validTo, X509Certificate2 signingCertificate) at Titanium.Web.Proxy.Network.Certificate.BCCertificateMaker.makeCertificateInternal(String subject, Boolean switchToMtaIfNeeded, X509Certificate2 signingCert) at Titanium.Web.Proxy.Network.Certificate.BCCertificateMaker.MakeCertificate(String sSubjectCn, X509Certificate2 signingCert) at Titanium.Web.Proxy.Network.CertificateManager.makeCertificate(String certificateName, Boolean isRootCertificate) at Titanium.Web.Proxy.Network.CertificateManager.CreateCertificate(String certificateName, Boolean isRootCertificate) 2022-01-21 13:28:50.1770|Error|HttpProxyS|ProxyServer ExceptionFunc | Titanium.Web.Proxy.Exceptions.ProxyConnectException: Couldn't authenticate host 'github.com' with certificate ''. ---> System.ArgumentNullException: Value cannot be null. (Parameter 'ServerCertificate') at System.Net.Security.SslStream.CreateAuthenticationOptions(SslServerAuthenticationOptions sslServerAuthenticationOptions) at System.Net.Security.SslStream.AuthenticateAsServerAsync(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken) at System.Net.Security.SslStream.AuthenticateAsServerAsync(X509Certificate serverCertificate, Boolean clientCertificateRequired, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation) at Titanium.Web.Proxy.ProxyServer.handleClient(TransparentBaseProxyEndPoint endPoint, TcpClientConnection clientConnection, Int32 port, CancellationTokenSource cancellationTokenSource, CancellationToken cancellationToken) --- End of inner exception stack trace --- at Titanium.Web.Proxy.ProxyServer.handleClient(TransparentBaseProxyEndPoint endPoint, TcpClientConnection clientConnection, Int32 port, CancellationTokenSource cancellationTokenSource, CancellationToken cancellationToken)

平台x86 win7 CPU 奔腾G4560 steam++最新版 firefox国际版 无其他个人证书 谢谢了