Skip to content

fix: report certificate expiration and fail library load on init errors - #513

Merged
devopvoid merged 2 commits into
mainfrom
fix/certificate-expiry-jni-onload
Nov 1, 2026
Merged

devopvoid merged 2 commits into
mainfrom
fix/certificate-expiry-jni-onload

Conversation

@devopvoid

Copy link
Copy Markdown
Owner
  • RTCCertificatePEM.getExpires() of native certificates (remote certificates of RTCDtlsTransport, getConfiguration()) was always 0. It now carries the certificate's expiration time in milliseconds, or the new EXPIRES_UNKNOWN (-1) if it cannot be read, passed to the constructor as a jlong instead of an int literal.
  • JNI_OnLoad lets no C++ exception escape, keeps the context local until it is fully initialized, cleans it up on failure and returns JNI_ERR, so the load fails with the translated exception. The JavaVM is now set apart from the context, since initializing it already needs the VM.

Native certificates carry their expiration time in milliseconds, or
RTCCertificatePEM.EXPIRES_UNKNOWN, passed as a jlong. JNI_OnLoad keeps
the context local until it is initialized, cleans it up on failure and
returns JNI_ERR; the VM is set apart from the context for that.
Repository owner deleted a comment from gitguardian Bot Nov 1, 2026
@devopvoid
devopvoid merged commit ab26f94 into main Nov 1, 2026
10 of 19 checks passed
@devopvoid
devopvoid deleted the fix/certificate-expiry-jni-onload branch November 1, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant