I did following Thing: httplistener-with-https-support I got no error through all steps but now if I want to connect to the listener, I get following Errors:
- From Chrome I get: "NET::ERR_CERT_COMMON_NAME_INVALID"
- From Edge I get: "DLG_FLAGS_SEC_CERT_CN_INVALID"
- From Firefox I get: "SEC_ERROR_UNKNOWN_ISSUER"
This is my Code:
static void Main(string[] args)
{
var prefixes = "https://*:8080/";
var listener = new HttpListener();
listener.Prefixes.Add(prefixes);
listener.Start();
Console.WriteLine("Listening...");
HttpListenerContext context = listener.GetContext();
HttpListenerRequest request = context.Request;
// Obtain a response object.
HttpListenerResponse response = context.Response;
// Construct a response.
string responseString = "<HTML><BODY> Hello world!</BODY></HTML>";
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
// Get a response stream and write the response to it.
response.ContentLength64 = buffer.Length;
System.IO.Stream output = response.OutputStream;
output.Write(buffer, 0, buffer.Length);
// You must close the output stream.
Console.ReadKey();
output.Close();
listener.Stop();
Here are my certifications: HERE
What did I wrong?