小编js8*_*s80的帖子

在Wireshark中解密HTTPS流量无法正常工作

我在Windows Server 2008 R2上运行Wireshark 1.8.6并试图解密传入的HTTPS通信以调试我看到的问题.

我正确设置了RSA密钥列表(我认为),但Wireshark不会出于某种原因解密SSL流量.我在过去调试与其他客户端系统的交换时已经开始工作了,所以我想知道这是否与这里使用的TLS有关(即我已经读过如果使用Diffie-Hellman你不能解密但我可以不知道这是用的东西.

我有我的RSA密钥列表条目如下:

IP Address: 192.168.1.27 (the IP address of the server)
Port: 7447
Protocol: http
Key File: set to my .pem (which I created using openssl from a .pfx containing both the public and private key).
Password: blank because it doesn't seem to need it for a .pem (Wireshark actually throws an error if I enter one).
Run Code Online (Sandbox Code Playgroud)

在我的Wireshark跟踪中,我可以看到Client Hello和Server Hello,但是应用程序数据没有被解密(右键单击 - > Follow SSL Stream什么都没有显示).

我的SSL日志粘贴在下面 - 这里有什么我想念的东西会告诉我解密失败的原因吗?我看到这样的一些条目令我担心,但我不确定如何解释它们:

packet_from_server: is from server - FALSE
decrypt_ssl3_record: …
Run Code Online (Sandbox Code Playgroud)

encryption ssl https wireshark

13
推荐指数
1
解决办法
3万
查看次数

WCF客户端 - 为WS-Security时间戳签名指定签名算法

我有一个WCF客户端正在向非WCF服务发送消息,并且该服务在处理用于签署WS-Security Timestamp元素的HMAC-SHA1签名方法时遇到问题.理想情况下,我们想使用RSA-SHA1签名方法,但我无法让WCF使用该签名方法.

我正在使用的绑定是一个自定义绑定,它允许我通过HTTPS发送SAML 2.0令牌:

<customBinding>
    <!-- This binding is a WS2007FederationHttpBinding without Secure Sessions that uses Text message encoding. -->
    <binding
        name="WS2007FederationHttpBinding_NoSecureSession_Text"
        closeTimeout="00:01:00"
        openTimeout="00:01:00"
        receiveTimeout="00:10:00"
        sendTimeout="00:01:00">
        <security
            authenticationMode="IssuedTokenOverTransport"
            requireSignatureConfirmation="true"
            securityHeaderLayout="Lax"
            messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
            keyEntropyMode="CombinedEntropy"
            includeTimestamp="true">
            <issuedTokenParameters
                tokenType="urn:oasis:names:tc:SAML:2.0:assertion">
                <!-- This describes the STS. That is, the URL, the binding to use, and its Identity -->
                <issuer
                    address="http://hostname//STS.svc"
                    binding="ws2007HttpBinding"
                    bindingConfiguration="StsUserNameBindingConfiguration">
                    <identity>
                        <!-- This is the certificate used for signing on the STS. -->
                        <!-- Replace "sts-signing-certificate-thumbprint" with the actual thumbprint of the STS's signing …
Run Code Online (Sandbox Code Playgroud)

c# wcf ws-security wcf-client xml-signature

9
推荐指数
1
解决办法
5494
查看次数

K3s kubeconfig 使用令牌而不是客户端证书进行身份验证

我在服务器上设置了 K3s:

curl -sfL https://get.k3s.io | K3S_TOKEN={token} INSTALL_K3S_EXEC="server --cluster-init --disable=traefik --write-kubeconfig-mode 644" sh -s -
Run Code Online (Sandbox Code Playgroud)

然后,我从中获取 kube 配置/etc/rancher/k3s/k3s.yaml并将其复制到本地计算机,这样我就可以从我的计算机而不是安装 K3s 的服务器节点与集群进行交互。我必须交换对 127.0.0.1 的引用,并将其更改为我安装了 K3s 的服务器的实际主机名,但除此之外它还有效。

然后,我使用以下方法将另外 2 个服务器节点连接到集群以实现高可用性设置:

curl -sfL https://get.k3s.io | K3S_TOKEN={token} INSTALL_K3S_EXEC="server --server {https://{hostname or IP of server 1}:6443 --disable=traefik --write-kubeconfig-mode 644" sh -s -
Run Code Online (Sandbox Code Playgroud)

现在,我再次在本地计算机上运行kubectl get pods(例如)并且可以正常工作,但我想要一个高度可用的设置,因此我在集群前面放置了一个 TCP 负载均衡器(实际上是 NGINX)。现在我尝试通过该代理/负载均衡器连接到 Kubernetes API,不幸的是,由于我~/.kube/config有用于身份验证的客户端证书,因此这不再起作用,因为位于该服务器前面的负载均衡器/代理无法通过我的客户端证书到 K3s 服务器。

我的~/.kube/config

curl -sfL https://get.k3s.io | K3S_TOKEN={token} INSTALL_K3S_EXEC="server --cluster-init --disable=traefik --write-kubeconfig-mode 644" sh -s -
Run Code Online (Sandbox Code Playgroud)

我还在我的 kube …

kubernetes k3s

5
推荐指数
1
解决办法
5781
查看次数

使用 Polly 在 ASP.NET Core 中重试请求时出现“流已被消耗”错误

我有一个 ASP.NET Core 3.1 Web API 服务,它正在接收 Web 请求,对其进行一些操作,然后将其传递到后端服务并同步返回响应。它工作正常,但我想为这些后端请求引入一些重试逻辑,以防出现一些问题。

我正在使用类型化的 HttpClient 并尝试使用 Polly 来实现重试逻辑: https://github.com/App-vNext/Polly/wiki/Polly-and-HttpClientFactory#using-polly-with-ihttpclientfactory

当后端服务工作时,一切似乎都很好,但不幸的是,每当我的后端返回诸如 500 内部服务器错误之类的错误时,我都会收到以下异常:

Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware: Error: An unhandled exception has occurred while executing the request.

System.Net.Http.HttpRequestException: An error occurred while sending the request.
 ---> System.InvalidOperationException: The stream was already consumed. It cannot be read again.
   at System.Net.Http.StreamContent.PrepareContent()
   at System.Net.Http.StreamContent.SerializeToStreamAsync(Stream stream, TransportContext context, CancellationToken cancellationToken)
   at System.Net.Http.HttpContent.CopyToAsync(Stream stream, TransportContext context, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnection.SendRequestContentAsync(HttpRequestMessage request, HttpContentWriteStream stream, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   --- End of …
Run Code Online (Sandbox Code Playgroud)

c# polly asp.net-core

3
推荐指数
1
解决办法
8319
查看次数