您可以使用HLS从HTTPS服务器流式传输吗? [英] Can you stream from a HTTPS server using HLS?

查看:2237
本文介绍了您可以使用HLS从HTTPS服务器流式传输吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用HLS从HTTPS服务器流式传输,使用以下代码 -

I'm wondering wether or not it's possible to stream from a HTTPS server using HLS, using the following code -

let url = NSURL(string:"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8")
        let player = AVPlayer(URL: url!)
        let playerController = AVPlayerViewController()

        playerController.player = player
        self.addChildViewController(playerController)
        self.view.addSubview(playerController.view)
        playerController.view.frame = self.view.frame

        player.play()

我可以流来自HTTP服务器,但当我将URL更改为我公司服务器的URL时,它不起作用,唯一的区别是我公司的视频在其URL中有HTTPS而苹果的示例视频没有,我是在XCode上的模拟器上进行测试

I can stream from an HTTP server, but when I changed the URL to the URL of my company's server it doesn't work, the only difference is that the video of my company has HTTPS in it's URL and apple's sample video doesn't, I'm testing on the Emulator in XCode

推荐答案

是的,您可以从HTTPS服务流式传输HLS河HLS流通过HTTP传输,HTTPS仅通过TLS进行HTTP传输,大多数情况下它对客户端是透明的。您唯一需要的是在播放器中支持所有主要的已经拥有的HTTPS。

Yes, you can stream HLS from an HTTPS server. HLS streams are transfered over HTTP and HTTPS is just HTTP over TLS and most of the time it is transparent to the client. The only thing you need is support for HTTPS in the player which all major ones already have.

https://devimages.apple.com/ iphone / samples / bipbop / bipbopall.m3u8 无效,因为 devimages.apple.com 证书无效。只需使用浏览器浏览网址即可。它会警告你,并提供有关确切错误的其他信息。

https://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 is not working because the devimages.apple.com certificate is invalid. Just browse the url using your browser. It will warn you and give you additional information about what exactly is wrong.

我猜您公司服务器的问题是相同的 - 错误或自签名证书。

I guess the problem with your company server is the same - wrong or self-signed certificate.

另一种验证https服务器的快捷方法是用户curl。例如:

Another quick way to validate an https server is to user curl. For example:

curl "https://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"

投诉:

curl: (51) SSL: no alternative certificate subject name matches target host name 'devimages.apple.com'

这篇关于您可以使用HLS从HTTPS服务器流式传输吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆