Elk Certificate name

gerasha

Member
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
 
If it is just an issue of being self-signed, then yes, accepting is fine. Most appliances/network devices use self-signed certificates, since in most cases, you can trust the webserver (it's a device on your network, not some random webserver on the internet), while still providing SSL encryption. This is assuming your code allows you to accept self-signed certificates.
 
Back
Top