How can I trust self signed SSL in Android Jitsi?

I’m trying to use Jitsi Android. I’ve already installed Jitsi-meet on our server. So, I want to connect the Android app with the server.

The problem is our server uses a self-signed certificate so we need to tell the Android app to trust and allow the connection to our server. Is it possible? I think the connection is made by Jitsi library.

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    URL serverURL;
    try {
        serverURL = new URL("https://our_public_ip"); //self signed url
    } catch (MalformedURLException e) {
        e.printStackTrace();
        throw new RuntimeException("Invalid server URL!");
    }
    JitsiMeetConferenceOptions defaultOptions = new JitsiMeetConferenceOptions.Builder()
            .setServerURL(serverURL)
            .setWelcomePageEnabled(false)
            .build();
    JitsiMeet.setDefaultConferenceOptions(defaultOptions);
}

public void onButoonClick(View v) {
    EditText editText = findViewById(R.id.conferenceName);
    String text = editText.getText().toString();

    if (text.length() > 0) {
        JitsiMeetConferenceOptions options
            = new JitsiMeetConferenceOptions.Builder()
                .setRoom(text)
                .build();
        JitsiMeetActivity.launch(this, options);
    }
}
}

** The error I'm getting on Android is

Failed to load config from my_public_ip/config.js?room=foo Error(AbortError){“message”:“Aborted”}

So, I’m not completely sure that self-signed certficate is the problem.

You need to import the cert into the system’s trust store. I’m not sure how one does that TBH.

Why don’t you save yourself some trouble and use a real cert? They are free of charge with Let’s Encrypt :slight_smile:

i’m having the same problem running jitsi on our local server .
in fact , android devices cannot have access to a self-signed certificate but also we cannot get let’s encrypt in local domain … so how can we do for testing

Why not?

Is there a way for an android device to accept a self signed certificate ?
Every time i try to connect to my local jitsi server i get the same error as engi .
Also is there a way to bypass this from the client side ?
keep in mind that i have a local server that is not deployed over the internet and i use the ip adress to access it.

This is not a use-case we really support. You might be able to make it work by putting the CA cert in the trust store, but otherwise there is nothing else you can do, other thasn modify the code to have okhhtp trust self-signed certs, but that is not something we will put in official builds.

I can’t find any reference to okhttp in the sdk files found on jitsi-meet github nor in the sdk i downloaded in my android project

It’s used by React Native itself, but we don’t directly manipulate it.