ERR_SSL_PROTOCOL_ERROR when running BlazorWebAppOidcServer

Zahra Ghadyani 40 Reputation points
2025-06-18T13:59:17.09+00:00

0

I am trying the sample code from

https://github.com/dotnet/blazor-samples/tree/main/8.0/BlazorWebAppOidcServer.

The Home and Count components work fine but the Login results in :

This site can’t provide a secure connection localhost sent an invalid response.

Try running Windows Network Diagnostics. ERR_SSL_PROTOCOL_ERROR

I am using .NET 8 and have tried these trouble shooting steps with no success:

1- adjust lunchsettings.js: "sslPort": 5001 2- used http instead of https 3- cleared browser

P.S. The oidcOptions are working fine in another example https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-5-B2C meaning I can sign in and out normally

Community Center Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. Pradeep M 9,765 Reputation points Microsoft External Staff Volunteer Moderator
    2025-06-19T04:19:34.44+00:00

    Hi Zahra Ghadyani

    Thank you for reaching out to Microsoft Q & A forum.     

    Thanks for reaching out. The ERR_SSL_PROTOCOL_ERROR typically indicates a problem with the local HTTPS configuration or development certificate. 

    Please try the following steps: 

    1.Reset and trust the development certificate by running: 

    dotnet dev-certs https --clean  
    dotnet dev-certs https --trust
    
    

    2.Check your launchSettings.json to ensure the HTTPS settings are correct: 

    "applicationUrl": "https://localhost:5001",
    "sslPort": 5001
    
    

    3.Try accessing the app in a different browser or an incognito/private window to rule out caching or certificate issues. 

    Also, ensure all redirect URIs in your configuration use HTTPS consistently. 

    If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community. 

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.