10

I need to connect to a server using only one cipher - "ADH-RC4-MD5". I'm looking for a generic solution which will enable me to check what cipher the server is using (I'm a provisioning server that acts as a client to many other application servers and need to connect and get data - each time it can be a different server).

The flow I had so far was:

TcpClient tcpClient = new TcpClient(serverName, port);
SslStream sslStream = new SslStream(tcpClient.GetStream(), false, null, null,                EncryptionPolicy.RequireEncryption);
sslStream.AuthenticateAsClient(HostName);

I keep on crash in the AuthenticateAsClient. The reason is that one AS is working only with the mentioned cipher.

I have verified this is the case with the SslScan tool.

I have tried to enter this cipher through the policy editor (gpedit.msc in the command line) but again with no luck.

Basically I'm looking for a way to use this cipher from code dynamically.

I have a working Java code:

sslsocket.setNeedClientAuth(true);
String[] list = new String[1];
list[0] = "ADH-RC4-MD5";
sslsocket.setEnabledCipherSuites(list);

Any idea of c# equivalent ?

4

1 回答 1

0

尝试以下操作:


0)重新检查支持哪些芯片

1) 检查您的服务器是否安装了以下安全更新(您需要将其删除http://support.microsoft.com/kb/2898850#AppliesToProducts

如果你使用win 8.1,它会被禁用,不确定其他人。如果您想知道 Microsoft 为何鼓励您禁用 RC4,请阅读内容。

2)我不知道 SslStream 允许您指定允许的密码套件,但是您可以使用:

http://www.example-code.com/csharp/dh_key_exchange.asp


Java“ADH-RC4-MD5”应该是

Supported Protocol = tls (or ssl version 3)
Cipher Algorithm Type = Rc4, 
Hash Algorithm Type = Md5 128 bit, 
Exchange Algorithm Type = DiffieHellman
于 2014-09-16T13:49:24.427 回答