Hi Guys,
I want to develop simple app to arm/disarm Elk. I know a lot of apps exist, but i need only 2-3 things to do.
So far I dont have a problem to use non secured port, but unable to connect to 2601. Elk always return invalid certificate name.
What name i need to provide? I tried IP, local machine name and etc.
Im getting
The remote certificate is invalid according to the validation procedure.
System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch | System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors
Here is a code
TcpClient client = new TcpClient(elkIP,2601);
Console.WriteLine("Client connected.");
// Create an SSL stream that will close the client's stream.
SslStream sslStream = new SslStream(
client.GetStream(),
false,
new RemoteCertificateValidationCallback (ValidateServerCertificate),
null
);
try
{
sslStream.AuthenticateAsClient(elkIP);
}
catch (AuthenticationException e)
Thanks
Gerasha
I want to develop simple app to arm/disarm Elk. I know a lot of apps exist, but i need only 2-3 things to do.
So far I dont have a problem to use non secured port, but unable to connect to 2601. Elk always return invalid certificate name.
What name i need to provide? I tried IP, local machine name and etc.
Im getting
The remote certificate is invalid according to the validation procedure.
System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch | System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors
Here is a code
TcpClient client = new TcpClient(elkIP,2601);
Console.WriteLine("Client connected.");
// Create an SSL stream that will close the client's stream.
SslStream sslStream = new SslStream(
client.GetStream(),
false,
new RemoteCertificateValidationCallback (ValidateServerCertificate),
null
);
try
{
sslStream.AuthenticateAsClient(elkIP);
}
catch (AuthenticationException e)
Thanks
Gerasha