Commit 1f87c806 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added JNI wrapper for linphone_core_verify_server_certificates and linphone_core_verify_server_cn

parent 71a43ebb
......@@ -8556,6 +8556,14 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setTlsKeyPath(JNIEnv *en
ReleaseStringUTFChars(env, jpath, path);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVerifyServerCertificates(JNIEnv *env, jobject, jlong lc, jboolean enabled) {
linphone_core_verify_server_certificates((LinphoneCore*)lc, enabled);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVerifyServerCN(JNIEnv *env, jobject, jlong lc, jboolean enabled) {
linphone_core_verify_server_cn((LinphoneCore*)lc, enabled);
}
extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getTlsCertificate(JNIEnv *env , jobject, jlong lc) {
const char* cert = linphone_core_get_tls_cert((LinphoneCore*)lc);
if (cert) {
......
......@@ -2491,6 +2491,18 @@ public interface LinphoneCore {
*/
public void setTlsKeyPath(String path);
/**
* Specify whether the tls server certificate must be verified when connecting to a SIP/TLS server.
* @param enable A boolean value telling whether the tls server certificate must be verified
*/
public void setVerifyServerCertificates(boolean enable);
/**
* Specify whether the tls server certificate common name must be verified when connecting to a SIP/TLS server.
* @param enable A boolean value telling whether the tls server certificate common name must be verified
*/
public void setVerifyServerCN(boolean enable);
/**
* Enable or not openh264
* @param enable
......
......@@ -1785,6 +1785,18 @@ class LinphoneCoreImpl implements LinphoneCore {
setTlsKeyPath(nativePtr, path);
}
private native void setVerifyServerCertificates(long ptr, boolean enable);
@Override
public void setVerifyServerCertificates(boolean enable) {
setVerifyServerCertificates(nativePtr, enable);
}
private native void setVerifyServerCN(long ptr, boolean enable);
@Override
public void setVerifyServerCN(boolean enable) {
setVerifyServerCN(nativePtr, enable);
}
public void enableOpenH264(boolean enable) {
openh264Enabled = enable;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment