Android - streaming video on local HTTPS server: SSL certificate rejected

I need to stream video through a local HTTPS server (of course, to do some background DRM) in Android. Then the Android media player connects to the local server, "streaming" the video content to the screen.

Everything works fine with the HTTP server, but as soon as I enable SSL, the video player stops.

If I connect to the HTTPS server from outside my application using a browser, I get an SSL warning that I can ignore, and then the video player starts.

Is there a way to turn off strict certificate processing for the media player module? I saw a lot of posts on how to do this using my own HTTP connection, but nothing on how to do this for a media player.

Thanks!

UPDATE: Google for “intranet certificate” or “instant certificate” and you will find something that should work. We’ll try it tomorrow and send the answer here.

+8
android certificate ssl video
source share
1 answer

You have to try this to make sure

// Create a trust manager that does not validate certificate chains TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted( java.security.cert.X509Certificate[] certs, String authType) { } public void checkServerTrusted( java.security.cert.X509Certificate[] certs, String authType) { } } }; // Install the all-trusting trust manager // Try "SSL" or Replace with "TLS" try { SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustAllCerts, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (Exception e) { } // Now you can access an https URL without having the certificate in the truststore // Your Code Goes Here 

Here are more solutions for this.
Certificate Verification in HTTPS Connection
Android: trust SSL certificates
stack overflow

0
source

All Articles