ERR_SSL_PROTOCOL_ERROR when connecting to Azure active directory

Anjali Agarwal 1,531 Reputation points
2021-11-16T18:17:04.73+00:00

I am trying to connect to azure active directory based on this article:

quickstart-v2-aspnet-webapp

I am running an MVC application and when I run the application connecting to azure active directory, my username and password is accepted, but then after that, I get an error showing "ERR_SSL_PROTOCOL_ERROR" . below is my sigin code:

public void SignIn()  
        {  
            if (!Request.IsAuthenticated)  
            {  
                HttpContext.GetOwinContext().Authentication.Challenge(  
                    new AuthenticationProperties { RedirectUri = "/" },  
                    OpenIdConnectAuthenticationDefaults.AuthenticationType);  
            }  
        }  

below is my configuration in the web.config file:

<appSettings>  
 <add key="ClientId" value="XXXXXXXXX" />  
    <add key="Tenant" value="XXXXXXXXXXXXXXXX" />  
    <add key="Authority" value="https://login.microsoftonline.com/{0}/v2.0" />  
    <add key="redirectUri" value="https://localhost:44347/login/oauth2/code/" />  
  </appSettings>  

My application is running on port # 44368

https://localhost:44368/

Below is the screen shot:

Uvaut.png

My applicationhost.config file binding information is like this:

<bindings>  
    <binding protocol="https" bindingInformation="*:44368:localhost" />  
    <binding protocol="http" bindingInformation="*:53016:localhost" />  
</bindings>  

I haven't changed any default settings that are created by the application. I didn't change the applicationhost.config file or the port number of the application. My redirectURI in the azure portal is 44347. Do I need to change anything in the applicationhost.config file or application port # in order to get rid of ERR_SSL_PROTOCOL_ERROR

Any help will be greatly appreciated.

Windows development Internet Information Services
Microsoft Security Microsoft Entra Microsoft Entra ID
Developer technologies ASP.NET Other
Developer technologies C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2021-11-16T19:05:15.203+00:00

    which component is getting the error? if the browser, your localhost SSL certificate is not trusted. if the web server, then you probably have not enabled TSL 1.2


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.