Date: Fri, 29 Mar 2024 14:10:27 +0100 (CET) Message-ID: <1725249442.47507.1711717827458@docs.flashphoner.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_47506_453601368.1711717827458" ------=_Part_47506_453601368.1711717827458 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
By default, Android SDK delegates SSL certificates checking to t= he system level while establishing secure Websocket connestion to a server.= On the system level, in its turn, server certificate is compared with syst= em certificate storage content.
In this case, if the server uses self-signed certificate (for debugging = purposes), this certificate will not pass the checking. Therefore since bui= ld 1.0.1.73 the session option= SessionOptions.trustAllCertificates = is added, false by default. To accept any certificates including self-signe= d ones,tis option should be set to true
SessionOptions se= ssionOptions =3D new SessionOptions(url); sessionOptions.trustAllCertificates(true);=20
Usage example:
= private CheckBox mTrustAllCer; ... mTrustAllCer =3D (CheckBox) findViewById(R.id.trust_all= _certificates_default); ... /** * The options for connection session are set. * WCS server URL is passed when SessionOptions object = is created. * SurfaceViewRenderer to be used to display video from= the camera is set with method SessionOptions.setLocalRenderer(). * SurfaceViewRenderer to be used to display preview st= ream video received from the server is set with method SessionOptions.setRe= moteRenderer(). */ SessionOptions sessionOptions =3D new SessionOptions(ur= l); sessionOptions.setLocalRenderer(localRender); sessionOptions.setRemoteRenderer(remoteRender); sessionOptions.trustAllCertificates(mTrustAllCer.isChec= ked());=20