Skip to content

Commit

Permalink
remove autoaccept cerftificates
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Nov 27, 2024
1 parent 805421a commit 51bc275
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions app/src/main/java/com/pedro/streamer/rotation/CameraFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,18 @@ import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.fragment.app.Fragment
import com.pedro.common.ConnectChecker
import com.pedro.library.base.recording.RecordController
import com.pedro.library.generic.GenericStream
import com.pedro.encoder.input.sources.video.Camera1Source
import com.pedro.encoder.input.sources.video.Camera2Source
import com.pedro.extrasources.CameraXSource
import com.pedro.library.base.recording.RecordController
import com.pedro.library.rtmp.RtmpStream
import com.pedro.library.util.BitrateAdapter
import com.pedro.streamer.R
import com.pedro.streamer.utils.PathUtils
import com.pedro.streamer.utils.toast
import java.security.cert.X509Certificate
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager

/**
* Example code to stream using StreamBase. This is the recommend way to use the library.
Expand Down Expand Up @@ -74,12 +70,6 @@ import javax.net.ssl.X509TrustManager
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
class CameraFragment: Fragment(), ConnectChecker {

class AcceptAllCertificates: X509TrustManager {
override fun checkClientTrusted(chain: Array<out X509Certificate>?, authType: String?) {}
override fun checkServerTrusted(chain: Array<out X509Certificate>?, authType: String?) {}
override fun getAcceptedIssuers(): Array<X509Certificate>? = null
}

companion object {
fun getInstance(): CameraFragment = CameraFragment()
}
Expand All @@ -88,7 +78,6 @@ class CameraFragment: Fragment(), ConnectChecker {
RtmpStream(requireContext(), this).apply {
getGlInterface().autoHandleOrientation = true
getStreamClient().setBitrateExponentialFactor(0.5f)
getStreamClient().addCertificates(AcceptAllCertificates())
}
}
private lateinit var surfaceView: SurfaceView
Expand Down

0 comments on commit 51bc275

Please sign in to comment.