ERR_SSL_PROTOCOL_ERROR when connecting to Azure active directory

Anjali Agarwal 1,366 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.

Internet Information Services
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,274 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,280 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,576 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,771 Reputation points
    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