Unable to obtain configuration from: 'https://<domain>oauth2/<appid>/.well-known/openid-configuration'

We are getting Unable “ Unable to obtain configuration from: 'https://<domain>oauth2/<appid>/.well-known/openid-configuration'” 

We are getting issue while integrating OKTA SDK with our API developed in ASP.NET Core running . The error we are getting is this: System.InvalidOperationException: IDX20803: Unable to obtain configuration from: ‘https://oauth2//.well-known/openid-configuration’. —\u003e System.IO.IOException: IDX20804: Unable to retrieve document from: ‘https://oauth2//.well-known/openid-configuration’. —\u003e System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. —\u003e System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

We’ve tried few option suggested online, but nothing worked.

Net Code
authentication middleware by using Okta.Aspnetcore nuget package by following below document.

               services.AddAuthentication(options =>
        {
            options.DefaultAuthenticateScheme = OktaDefaults.ApiAuthenticationScheme;
            options.DefaultChallengeScheme = OktaDefaults.ApiAuthenticationScheme;
            options.DefaultSignInScheme = OktaDefaults.ApiAuthenticationScheme;
        })
        .AddOktaWebApi(new OktaWebApiOptions()
        {
            OktaDomain = Configuration["Okta:OktaDomain"],
            Audience = "sampleAud",
            AuthorizationServerId = "xxxxxx",
        });

If you have a developer account, the URL should be https://<domain>/oauth2/<authorization-server-id>/.well-known/openid-configuration. For example, mine is https://dev-1106225.okta.com/oauth2/default/.well-known/openid-configuration.

this is our URL https:/xxx.oktapreview.com/oauth2/customAuthServerId/.well-known/oauth-authorization-server. Any suggestion?

Does https://xxx.oktapreview.com/oauth2/customAuthServerId/.well-known/openid-configuration resolve for you? If it does, try setting the AuthorizationServerId in your code to be customAuthServerId.