Cannot read property 'ssl' of null on Launch

4215
2
05-28-2015 05:08 PM
AndrewTerwiel
Occasional Contributor II

I get this error in the console when I try to "Launch" my app. I found that an extra condition in the ConfigManager.js, where the error occurs, resolves this.

Line 472:

_processWebTier: function(appConfig){

    var def = new Deferred();

    var portalUrl = appConfig.portalUrl;

    if(appConfig.isWebTier){

        //Although it is recommended to enable ssl for IWA/PKI portal by Esri,

        //there is no force on the client. They still can use http for IWA/PKI.

        //It is not correnct to assume web-tier authorization only works with https.

        tokenUtils.isWebTierPortal(portalUrl).then(lang.hitch(this, function(isWebTier) {

            var credential = tokenUtils.getPortalCredential(portalUrl);

            if(credential){ // condition added by alterwiel

                if(credential.ssl){

                    //if credential.ssl, it means that the protal is allSSL enabled

                    if(window.location.protocol === 'http:' && !tokenUtils.isInConfigOrPreviewWindow()){

                        window.location.protocol = 'https:';

                        return;

                    }

                }

            }

            def.resolve(isWebTier);

        }), lang.hitch(this, function(err) {

            def.reject(err);

        }));

    }else{

        def.resolve(false);

    }

    return def;

}

2 Replies
GrégoryFERELLOC
New Contributor

Same issue. same solution

Hope they will fix it in a new version (1.3? ).

0 Kudos
AndrewTerwiel
Occasional Contributor II

In the meantime... another day, another bug to fix. That's what we're paid for.

0 Kudos