Adds SSLCertificateVerifier to the Java API.
The native API supports setting an SSLCertificateVerifier that can be used to provide a custom certificate verifier for incoming SSL certificates. This change provides this functionality to the Java API so that a Java implementation can also be provided. It is expected this will only be used in specialized circumstances and most users will not hit this code path. Bug: webrtc:9541 Change-Id: Id3c75b8f288333b53edc2959bac533e3ec614978 Reviewed-on: https://webrtc-review.googlesource.com/89500 Commit-Queue: Benjamin Wright <benwright@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24057}
This commit is contained in:

committed by
Commit Bot

parent
2ffed6d65c
commit
8cf30401eb
@ -328,6 +328,25 @@ public class PeerConnectionFactory {
|
||||
this.nativeFactory = nativeFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal helper function to pass the parameters down into the native JNI bridge.
|
||||
*/
|
||||
@Nullable
|
||||
PeerConnection createPeerConnectionInternal(PeerConnection.RTCConfiguration rtcConfig,
|
||||
MediaConstraints constraints, PeerConnection.Observer observer,
|
||||
SSLCertificateVerifier sslCertificateVerifier) {
|
||||
long nativeObserver = PeerConnection.createNativePeerConnectionObserver(observer);
|
||||
if (nativeObserver == 0) {
|
||||
return null;
|
||||
}
|
||||
long nativePeerConnection = nativeCreatePeerConnection(
|
||||
nativeFactory, rtcConfig, constraints, nativeObserver, sslCertificateVerifier);
|
||||
if (nativePeerConnection == 0) {
|
||||
return null;
|
||||
}
|
||||
return new PeerConnection(nativePeerConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated. PeerConnection constraints are deprecated. Supply values in rtcConfig struct
|
||||
* instead and use the method without constraints in the signature.
|
||||
@ -336,16 +355,8 @@ public class PeerConnectionFactory {
|
||||
@Deprecated
|
||||
public PeerConnection createPeerConnection(PeerConnection.RTCConfiguration rtcConfig,
|
||||
MediaConstraints constraints, PeerConnection.Observer observer) {
|
||||
long nativeObserver = PeerConnection.createNativePeerConnectionObserver(observer);
|
||||
if (nativeObserver == 0) {
|
||||
return null;
|
||||
}
|
||||
long nativePeerConnection =
|
||||
nativeCreatePeerConnection(nativeFactory, rtcConfig, constraints, nativeObserver);
|
||||
if (nativePeerConnection == 0) {
|
||||
return null;
|
||||
}
|
||||
return new PeerConnection(nativePeerConnection);
|
||||
return createPeerConnectionInternal(
|
||||
rtcConfig, constraints, observer, /* sslCertificateVerifier= */ null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -376,7 +387,8 @@ public class PeerConnectionFactory {
|
||||
@Nullable
|
||||
public PeerConnection createPeerConnection(
|
||||
PeerConnection.RTCConfiguration rtcConfig, PeerConnectionDependencies dependencies) {
|
||||
return createPeerConnection(rtcConfig, null /* constraints */, dependencies.getObserver());
|
||||
return createPeerConnectionInternal(rtcConfig, null /* constraints */,
|
||||
dependencies.getObserver(), dependencies.getSSLCertificateVerifier());
|
||||
}
|
||||
|
||||
public MediaStream createLocalMediaStream(String label) {
|
||||
@ -514,7 +526,8 @@ public class PeerConnectionFactory {
|
||||
VideoDecoderFactory decoderFactory, long nativeAudioProcessor,
|
||||
long nativeFecControllerFactory);
|
||||
private static native long nativeCreatePeerConnection(long factory,
|
||||
PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, long nativeObserver);
|
||||
PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, long nativeObserver,
|
||||
SSLCertificateVerifier sslCertificateVerifier);
|
||||
private static native long nativeCreateLocalMediaStream(long factory, String label);
|
||||
private static native long nativeCreateVideoSource(long factory, boolean is_screencast);
|
||||
private static native long nativeCreateVideoTrack(
|
||||
|
Reference in New Issue
Block a user