Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposed APIs related to verify server certicates to JNI #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions coreapi/linphonecore_jni.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6870,3 +6870,12 @@ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_setUserCertificat
if (path) env->ReleaseStringUTFChars(jpath, path);
}


JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_verifyServerCertificates(JNIEnv *env, jobject thiz, jlong lc, jboolean yesno) {
linphone_core_verify_server_certificates((LinphoneCore *)lc, yesno);
}

JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_verifyServerCn(JNIEnv *env, jobject thiz, jlong lc, jboolean yesno) {
linphone_core_verify_server_cn((LinphoneCore *)lc, yesno);
}

4 changes: 4 additions & 0 deletions java/common/org/linphone/core/LinphoneCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -2284,4 +2284,8 @@ public static TunnelMode intToEnum(int value) {
* Set user certificates directory path (used by SRTP-DTLS).
*/
public void setUserCertificatesPath(String path);

public void verifyServerCn(boolean yesno);

public void verifyServerCertificates(boolean yesno);
}
12 changes: 12 additions & 0 deletions java/impl/org/linphone/core/LinphoneCoreImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1636,4 +1636,16 @@ public void setDnsServers(String servers[]){
public void setUserCertificatesPath(String path) {
setUserCertificatesPath(nativePtr, path);
}

private native void verifyServerCertificates(long nativePtr, boolean yesno);
@Override
public void verifyServerCertificates(boolean yesno) {
verifyServerCertificates(nativePtr, yesno);
}

private native void verifyServerCn(long nativePtr, boolean yesno);
@Override
public void verifyServerCn(boolean yesno) {
verifyServerCn(nativePtr, yesno);
}
}