kuzzleio / sdk-android

Official android SDK for Kuzzle
http://docs.kuzzle.io/sdk-reference
Apache License 2.0
4 stars 2 forks source link

Add SSL support to connect to Kuzzle #115

Closed benoitvidis closed 5 years ago

TitanKing commented 5 years ago

Is technical difficulties the reason this was not yet implemented? I am working on a Android Kotlin SDK for Kuzzle. One of the obstacles is this before I tackle the availability of SSL, I first need to know what is the reason this was not yet implemented so I do not run into the same limitations.

jenow commented 5 years ago

Is technical difficulties the reason this was not yet implemented? I am working on a Android Kotlin SDK for Kuzzle. One of the obstacles is this before I tackle the availability of SSL, I first need to know what is the reason this was not yet implemented so I do not run into the same limitations.

We now generate our Android SDK with SWIG from our GO SDK (which is then compiled in C and C++) and we simply forgot to add the ssl_connection inside the options struct, this is being fixed.

mbracq commented 5 years ago

Is technical difficulties the reason this was not yet implemented? I am working on a Android Kotlin SDK for Kuzzle. One of the obstacles is this before I tackle the availability of SSL, I first need to know what is the reason this was not yet implemented so I do not run into the same limitations.

We now generate our Android SDK with SWIG from our GO SDK (which is then compiled in C and C++) and we simply forgot to add the ssl_connection inside the options struct, this is being fixed.

Hi jenow, when the next release is planned?

jenow commented 5 years ago

Is technical difficulties the reason this was not yet implemented? I am working on a Android Kotlin SDK for Kuzzle. One of the obstacles is this before I tackle the availability of SSL, I first need to know what is the reason this was not yet implemented so I do not run into the same limitations.

We now generate our Android SDK with SWIG from our GO SDK (which is then compiled in C and C++) and we simply forgot to add the ssl_connection inside the options struct, this is being fixed.

Hi jenow, when the next release is planned?

I don't have a precise date but we are actually finishing the documentation, the SDK per se is ready.

jenow commented 5 years ago

A workaround to be able to use SSL with the version 3 of the SDK would be to add

implementation 'io.socket:socket.io-client:1.0.0' 

in the build.gradle and then add these import

import io.socket.client.IO;
import io.socket.client.Socket;

and then do this:

        Kuzzle k = null;
        try {
            k = new Kuzzle("kuzzle_host") {
                @Override
                protected Socket createSocket() throws URISyntaxException {
                    IO.Options opt = new IO.Options();
                    opt.forceNew = false;
                    opt.reconnection = this.autoReconnect;
                    opt.reconnectionDelay = this.reconnectionDelay;
                    return IO.socket("https://" + host + ":" + this.port, opt);
                }
            };
            k.connect();

        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
jenow commented 5 years ago

SSL support has been added in this version https://github.com/kuzzleio/sdk-android/releases/tag/3.0.9