Playing mkv from https with self signed certificate on iOS device

This forum is about all development around libVLC.
s6060304
New Cone
New Cone
Posts: 1
Joined: 07 Nov 2016 11:54

Playing mkv from https with self signed certificate on iOS device

Postby s6060304 » 08 Nov 2016 08:02

replace https://172.16.2.240:8001 with MYURL
replace path?querystring with FILEPATH

Hello,
As title, I always fail when I use mobileVLCKit iOS2.8, master which is build from source code. I also try mobileVLCKit iOS2.7 and moblieVLCKit stable 2.2.2 which are get from cocoapods and that are fail, either.
Only mobileVLCKit stable 2.2.2 will pop an alertView to ask me if I want to accept self signed certificate or not, but it will pop another alertView to say that It can't be played.
the other three will say "cannot access MyUrl" without popping an alertView to ask me if I want to accept self signed certificate.
above of four mobileVLCKit can play mkv from http.

When I use VLC for iOS(ver2.7.8) first time, the alertView will pop out and ask me if I can accept self signed certificate or not. If I choose "Accept" , the video will be played. Strangely, it will fail when I want to play from same source twice, maybe it is another bug.
I also try VLC on mac , and it always play successfully after accept the self signed certificate.

//below is error message when I use mobileVLCKit iOS 2.8
2016-10-21 14:28:54.119 testVLCKit-iOS2.8[970:530153] creating player instance using shared library
2016-10-21 14:28:54.151 testVLCKit-iOS2.8[970:530153] VLC media player - 3.0.0-git Vetinari
2016-10-21 14:28:54.152 testVLCKit-iOS2.8[970:530153] Copyright © 1996-2016 the VideoLAN team
2016-10-21 14:28:54.152 testVLCKit-iOS2.8[970:530153] revision 2.2.0-git-8358-gd9be8d3
2016-10-21 14:28:54.152 testVLCKit-iOS2.8[970:530153] configured with /Volumes/HD-PATU3/ForWork/VLCKit-master/VLCKit-master-bfdcee6c3ccc7666e42091ea1b2f39903e775781/MobileVLCKit/ImportedSources/vlc/configure '--prefix=/Volumes/HD-PATU3/ForWork/VLCKit-master/VLCKit-master-bfdcee6c3ccc7666e42091ea1b2f39903e775781/MobileVLCKit/ImportedSources/vlc/install-ios-iPhoneOS/arm64' '--host=aarch64-apple-darwin11' '--with-contrib=/Volumes/HD-PATU3/ForWork/VLCKit-master/VLCKit-master-bfdcee6c3ccc7666e42091ea1b2f39903e775781/MobileVLCKit/ImportedSources/vlc/contrib/iPhone-aarch64-apple-darwin11-aarch64' '--enable-static' '--disable-debug' '--enable-dvbpsi' '--enable-avcodec' '--disable-vpx' '--enable-neon' '--disable-macosx' '--disable-macosx-qtkit' '--disable-macosx-eyetv' '--disable-macosx-vlc-app' '--disable-macosx-avfoundation' '--disable-audioqueue' '--disable-shared' '--enable-macosx-quartztext' '--enable-mkv' '--enable-opus' '--disable-faad' '--disable-lua' '--disable-a52' '--enable-fribidi' '--disable-qt' '--disable-skins2' '--disable-vcd' '--disable-vlc' '--disable-vlm' '--disable-httpd' '--disable-nls' '--disable-sse' '--disable-notify' '--enable-live555' '--enable-realrtsp' '--enable-swscale' '--disable-projectm' '--enable-libass' '--enable-libxml2' '--disable-goom' '--disable-dvdread' '--disable-dvdnav' '--disable-bluray' '--disable-linsys' '--disable-libva' '--disable-gme' '--disable-tremor' '--enable-vorbis' '--disable-fluidsynth' '--disable-jack' '--disable-pulse' '--disable-mtp' '--enable-ogg' '--enable-speex' '--enable-theora' '--enable-flac' '--disable-screen' '--enable-freetype' '--enable-taglib' '--disable-mmx' '--disable-addonmanagermodules' '--disable-mad' 'host_alias=aarch64-apple-darwin11' 'CC=xcrun clang' 'CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -arch arm64 -O3 -g -miphoneos-version-min=7.0' 'LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/usr/lib -arch arm64 -Wl,-ios_version_min,7.0' 'CPPFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -arch arm64 -O3 -g -miphoneos-version-min=7.0' 'CPP=xcrun cc -E' 'CXX=xcrun clang++' 'CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -arch arm64 -O3 -g -miphoneos-version-min=7.0' 'OBJC=xcrun clang' 'CCAS=gas-preprocessor.pl xcrun clang' 'CXXCPP=xcrun c++ -E' 'AVCODEC_CFLAGS=-I/Volumes/HD-PATU3/ForWork/VLCKit-master/VLCKit-master-bfdcee6c3ccc7666e42091ea1b2f39903e775781/MobileVLCKit/ImportedSources/vlc/install-ios-iPhoneOS/arm64/include ' 'AVCODEC_LIBS=-L/Volumes/HD-PATU3/ForWork/VLCKit-master/VLCKit-master-bfdcee6c3ccc7666e42091ea1b2f39903e775781/MobileVLCKit/ImportedSources/vlc/install-ios-iPhoneOS/arm64/lib -lavcodec -lavutil -lz' 'AVFORMAT_CFLAGS=-I/Volumes/HD-PATU3/ForWork/VLCKit-master/VLCKit-master-bfdcee6c3ccc7666e42091ea1b2f39903e775781/MobileVLCKit/ImportedSources/vlc/install-ios-iPhoneOS/arm64/include' 'AVFORMAT_LIBS=-L/Volumes/HD-PATU3/ForWork/VLCKit-master/VLCKit-master-bfdcee6c3ccc7666e42091ea1b2f39903e775781/MobileVLCKit/ImportedSources/vlc/install-ios-iPhoneOS/arm64/lib -lavcodec -lz -lavutil -lavformat'
2016-10-21 14:28:54.155 testVLCKit-iOS2.8[970:530153] strUrl = MYURL/FILEPATH
2016-10-21 14:28:54.156 testVLCKit-iOS2.8[970:530153] strUrl = MYURL/FILEPATH
2016-10-21 14:28:54.245 testVLCKit-iOS2.8[970:530153] viewDidAppear
2016-10-21 14:28:54.251 testVLCKit-iOS2.8[970:530246] Creating an input for 'FILE'
2016-10-21 14:28:54.254 testVLCKit-iOS2.8[970:530247] using timeshift granularity of 50 MiB
2016-10-21 14:28:54.254 testVLCKit-iOS2.8[970:530247] using default timeshift path
2016-10-21 14:28:54.255 testVLCKit-iOS2.8[970:530247] `MYURL/FILEPATH' gives access `https' demux `' path `172.16.2.240:8001/FILEPATH'
2016-10-21 14:28:54.255 testVLCKit-iOS2.8[970:530247] specified demux: any
2016-10-21 14:28:54.255 testVLCKit-iOS2.8[970:530247] creating demux: access='https' demux='any' location='172.16.2.240:8001/FILEPATH' file='(null)'
2016-10-21 14:28:54.255 testVLCKit-iOS2.8[970:530247] looking for access_demux module matching "https": 3 candidates
2016-10-21 14:28:54.259 testVLCKit-iOS2.8[970:530247] no access_demux modules matched
2016-10-21 14:28:54.259 testVLCKit-iOS2.8[970:530247] creating access: MYURL/FILEPATH
2016-10-21 14:28:54.259 testVLCKit-iOS2.8[970:530247] looking for access module matching "https": 21 candidates
2016-10-21 14:28:54.260 testVLCKit-iOS2.8[970:530247] looking for tls client module matching "any": 1 candidates
2016-10-21 14:28:54.260 testVLCKit-iOS2.8[970:530247] open st client
2016-10-21 14:28:54.260 testVLCKit-iOS2.8[970:530247] using tls client module "securetransport"
2016-10-21 14:28:54.265 testVLCKit-iOS2.8[970:530248] resolving 172.16.2.240 ...
2016-10-21 14:28:54.268 testVLCKit-iOS2.8[970:530248] connecting to 172.16.2.240 port 8001 ...
2016-10-21 14:28:54.304 testVLCKit-iOS2.8[970:530248] open TLS session for 172.16.2.240
2016-10-21 14:28:54.306 testVLCKit-iOS2.8[970:530248] handshake is blocked, try again later
2016-10-21 14:28:54.322 testVLCKit-iOS2.8[970:530248] SSLHandshake returned errSSLServerAuthCompleted, continuing handshake
2016-10-21 14:28:54.331 testVLCKit-iOS2.8[970:530248] handshake is blocked, try again later
2016-10-21 14:28:54.381 testVLCKit-iOS2.8[970:530248] cerfificate verification failed, result is 5
2016-10-21 14:28:54.381 testVLCKit-iOS2.8[970:530248] TLS session handshake error
2016-10-21 14:28:54.381 testVLCKit-iOS2.8[970:530248] close TLS session
2016-10-21 14:28:54.383 testVLCKit-iOS2.8[970:530247] HTTP connection failure
2016-10-21 14:28:54.383 testVLCKit-iOS2.8[970:530247] close secure transport client
2016-10-21 14:28:54.385 testVLCKit-iOS2.8[970:530247] looking for tls client module matching "any": 1 candidates
2016-10-21 14:28:54.385 testVLCKit-iOS2.8[970:530247] open st client
2016-10-21 14:28:54.385 testVLCKit-iOS2.8[970:530247] using tls client module "securetransport"
2016-10-21 14:28:54.386 testVLCKit-iOS2.8[970:530247] querying proxy for MYURL/FILEPATH
2016-10-21 14:28:54.386 testVLCKit-iOS2.8[970:530247] no proxy
2016-10-21 14:28:54.386 testVLCKit-iOS2.8[970:530247] http: server='172.16.2.240' port=8001 file='FILEPATH(without ?querystring)'
2016-10-21 14:28:54.386 testVLCKit-iOS2.8[970:530247] net: connecting to 172.16.2.240 port 8001
2016-10-21 14:28:54.390 testVLCKit-iOS2.8[970:530247] connection succeeded (socket = 4)
2016-10-21 14:28:54.390 testVLCKit-iOS2.8[970:530247] open TLS session for 172.16.2.240
2016-10-21 14:28:54.391 testVLCKit-iOS2.8[970:530247] handshake is blocked, try again later
2016-10-21 14:28:54.405 testVLCKit-iOS2.8[970:530247] SSLHandshake returned errSSLServerAuthCompleted, continuing handshake
2016-10-21 14:28:54.412 testVLCKit-iOS2.8[970:530247] handshake is blocked, try again later
2016-10-21 14:28:54.462 testVLCKit-iOS2.8[970:530247] cerfificate verification failed, result is 5
2016-10-21 14:28:54.462 testVLCKit-iOS2.8[970:530247] TLS session handshake error
2016-10-21 14:28:54.462 testVLCKit-iOS2.8[970:530247] close TLS session
2016-10-21 14:28:54.464 testVLCKit-iOS2.8[970:530247] cannot establish HTTP/TLS session
2016-10-21 14:28:54.465 testVLCKit-iOS2.8[970:530247] close secure transport client
2016-10-21 14:28:54.466 testVLCKit-iOS2.8[970:530247] no access modules matched
2016-10-21 14:28:54.466 testVLCKit-iOS2.8[970:530247] cannot access MyUrl/FILEPATH
2016-10-21 14:28:54.467 testVLCKit-iOS2.8[970:530247] Your input can't be opened
2016-10-21 14:28:54.468 testVLCKit-iOS2.8[970:530247] VLC is unable to open the MRL 'MYURL/FILEPATH'. Check the log for details

Sorry about my poor English, and thanks for your reading!
I have been sucked by this problem for few month QQ~

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Playing mkv from https with self signed certificate on iOS device

Postby Jean-Baptiste Kempf » 07 Dec 2016 00:40

Update libVLC.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

linked
Blank Cone
Blank Cone
Posts: 41
Joined: 28 Nov 2014 09:12

Re: Playing mkv from https with self signed certificate on iOS device

Postby linked » 06 Mar 2017 23:14

The only version i get it working is 2.7 branch but the question (that don't appear in this 2.7 version) has a bug. The result is never used to trust the cetificate.
Answer var is not good. Just bypass this piece of code in securetransport.c around line 326. Remove the if line that check for answer to force it like a always YES.

Version 3.0pre2 force close with this hack because of some closing bug that is fixed by later commit.
Version 3.0pre3 display 1 picture and say buffering forever but is just stuck somewhere.
Version 2.7 is the only that works.
Version 2.8 not tested.

If you need some help about the last compilation step, here is a link:
https://forum.videolan.org/viewtopic.php?t=137795


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests