How to create SSL certificate and use it with ionic plugin to communicate with Server


#1

Hello guyz,

I am first timer @ SSL secured gateway thing.
My intend is to create a client certificate and and perform SSL handshake with client web site where the files are uploaded.
Use the secured connection to read .json files via http.GET request.

Please help me to acquire this task using ionic v1.


#3

What exactly is the problem?
What exactly do you want to implement?
What does “client certificate” and “client web site” mean in this context?


#4

@Sujan12

I have online data files in .json format which can be read using $http but these files are secured via https(SSL layer),
To view read these files with http GET request we can also use plain SSL:

I am trying to use PLAIN SSL method to access and read JSON file from server. Files are uploaded to secured website.

I am able to create session token by sending a POST request at authentication URL:

https://eg.com/login?idpid=at_&user=user@eg.com&password=mypassword&interactive=0
response:

{
    "status": "authenticated",
    "sessiontk": "Njk2Y2I3NzNkM5NGFmYTA1Y2M0MzUyMmM5ZWY2YTk0NmIwOWIwZTFkMDdmM2FlNmU3NWZmNzU3YzBhMzNAMjAxNy0xMC0xMVQwNjowNjowMy45MjNa",
    "target": "/sec-gw/login?idpid=at&interactive=0&user=user@eg.com"
}

But after that I am unable to use the token to open session to read .json file from website:

eg: https://eg.com/languages.json

I used this:

$http({
                        method : 'GET',
                        url : jsonPath,
                        headers : {
                        'Authorization' : 'Basic Njk2Y2I3NzNkM5NGFmYTA1Y2M0MzUyMmM5ZWY2YTk0NmIwOWIwZTFkMDdmM2FlNmU3NWZmNzU3YzBhMzNAMjAxNy0xMC0xMVQwNjowNjowMy45MjNa'
                        }
                    .then(function (response) {//
},function(error){//
});

It returns 401 unauthorized . please help me , is there any other way to access this via cookie session or something


#5

This has nothing to do with HTTPS - it doesn’t matter if you request a file via http:// or https://.

You seem to have a problem with authentication. For that we can’t help you as this is different for each service. No idea if the session token should be sent as an Authorization header.