Skip to content

Option to serve HTTP instead of HTTPS #12

@devurandom

Description

@devurandom

My application refused to talk to OTLPView because of self-signed certificates (and I got warnings in my browser).

Patching the source code fixed it:

diff --git a/OTLPView/Program.cs b/OTLPView/Program.cs
index d57568a..8bba234 100644
--- a/OTLPView/Program.cs
+++ b/OTLPView/Program.cs
@@ -22,14 +22,12 @@ builder.WebHost.ConfigureKestrel(options =>
     options.ListenAnyIP(otlpPort, listenOptions =>
     {
         listenOptions.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http2;
-        listenOptions.UseHttps();
     });
     foreach (var port in webPorts)
     {
         options.ListenAnyIP(port, listenOptions =>
         {
             listenOptions.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http1AndHttp2;
-            listenOptions.UseHttps();
         });
     }
 });
@@ -40,16 +38,12 @@ var app = builder.Build();
 if (!app.Environment.IsDevelopment())
 {
     app.UseExceptionHandler("/Error");
-    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
-    app.UseHsts();
 }

 app.MapGrpcService<DefaultMetricsService>();
 app.MapGrpcService<DefaultTraceService>();
 app.MapGrpcService<DefaultLogsService>();

-app.UseHttpsRedirection();
-
 app.UseStaticFiles();

 app.UseRouting();

It would be nice if there was an --insecure=true commandline flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions