Visual studio 2022 aspnetcore 6 web api template https stop working

NTN 1 Reputation point
2022-08-11T08:10:29.407+00:00

am trying to run a web api application created with Visual Studio 2022 on my windows 10 laptop and keep receiving this ERR_SSL_VERSION_OR_CIPHER_MISMATCH, both on Chrome and Edge. The startup code for the application:

var builder = WebApplication.CreateBuilder(args);  
  
// Add services to the container.  
  
builder.Services.AddControllers();  
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle  
builder.Services.AddEndpointsApiExplorer();  
builder.Services.AddSwaggerGen();  
  
var app = builder.Build();  
  
// Configure the HTTP request pipeline.  
if (app.Environment.IsDevelopment())  
{  
    app.UseSwagger();  
    app.UseSwaggerUI();  
}  
  
app.UseHttpsRedirection();  
  
app.UseAuthentication();  
app.UseAuthorization();  
  
app.MapControllers();  
  
app.Run();  
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,207 questions
{count} votes

3 answers

Sort by: Most helpful
  1. satya karki 986 Reputation points MVP
    2022-08-11T08:21:45.5+00:00

    Hi

    This error occurs mainly because of a problem with the SSL certificate or encryption modules. We can take some server-side actions to resolve this issue.
    For your reference
    https://phoenixnap.com/kb/fix-err-ssl-version-or-cipher-mismatch

    1 person found this answer helpful.
    0 comments No comments

  2. Rijwan Ansari 746 Reputation points MVP
    2022-08-11T08:29:15.647+00:00

    Hi

    Try adding

    <PropertyGroup>  
      <UseAppHost>false</UseAppHost>  
    </PropertyGroup>  
    

    You can check below links for troubleshooting.
    https://github.com/dotnet/aspnetcore/issues/18236
    https://wpdatatables.com/err_ssl_version_or_cipher_mismatch/

    0 comments No comments

  3. Rijwan Ansari 746 Reputation points MVP
    2022-08-11T08:30:46.047+00:00

    Hi

    Try adding

    <PropertyGroup>  
      <UseAppHost>false</UseAppHost>  
    </PropertyGroup>  
    

    https://github.com/dotnet/aspnetcore/issues/18236

    0 comments No comments