gpt4 book ai didi

ssl - 为什么 Icecast2 不想通过 https 提供流?

转载 作者:太空宇宙 更新时间:2023-11-03 12:45:53 24 4
gpt4 key购买 nike

在装有 Ubuntu 14.04 LTS 的服务器上安装了支持 SSL 的 Icecast2 2.4.1。同样在此服务器上工作的 HTTPS 网站。我想在页面上插入 HTML5 播放器,它也将通过 SSL 获取流(否则 - 混合内容错误)。该网站有一个商业 SSL 证书,Icecast - 一个自签名的。Icecast 配置文件:

<icecast>
<location>****</location>
<admin>admin@*************</admin>
<limits>
<clients>1000</clients>
<sources>2</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<source-timeout>10</source-timeout>
<burst-on-connect>0</burst-on-connect>
<burst-size>65535</burst-size>
</limits>
<authentication>
<source-password>*****</source-password>
<relay-password>*****</relay-password>
<admin-user>*****</admin-user>
<admin-password>*****</admin-password>
</authentication>
<hostname>************</hostname>
<listen-socket>
<port>8000</port>
<ssl>1</ssl>
</listen-socket>
<mount>
<mount-name>/stream</mount-name>
<charset>utf-8</charset>
</mount>
<mount>
<mount-name>/ogg</mount-name>
<charset>utf-8</charset>
</mount>
<fileserve>1</fileserve>
<paths>
<basedir>/usr/share/icecast2</basedir>
<logdir>/var/log/icecast2</logdir>
<webroot>/usr/share/icecast2/web</webroot>
<adminroot>/usr/share/icecast2/admin</adminroot>
<alias source="/" dest="/status.xsl"/>
<ssl-certificate>/etc/icecast2/icecast2.pem</ssl-certificate>
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<loglevel>4</loglevel>
</logging>
<security>
<chroot>0</chroot>
<changeowner>
<user>icecast2</user>
<group>icecast</group>
</changeowner>
</security>
</icecast>

Icecast 证书 (/etc/icecast2/icecast2.pem) 生成者:

openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout icecast2.pem -out icecast2.pem

我希望从地址 https://domain.name:8000/stream 得到输出流https://domain.name:8000/ogg用于通过标签音频插入播放器,但作为响应 - 静音。因此,带有简单 http 的地址一切正常。没看懂什么都一样的错误...预先感谢您的帮助!

最佳答案

我最近遇到了这个问题,但没有太多时间来解决它,也没有看到很多相关文档。我认为它不是使用最广泛的 icecast 配置,所以我只是用 nginx 代理我的配置,它工作正常。

这是一个 nginx 虚拟主机示例。请务必更改域、检查您的路径并考虑您希望挂载代理到的位置以及您希望如何处理端口。

请注意,这将使您的流在端口 443 而不是 8000 上可用。某些客户端(例如 facebookexternalhit/1.1)可能会尝试卡在流上,认为它是一个等待连接的 https url。这可能不是您期望或希望的行为。

此外,如果您根本不想使用 http,请务必将绑定(bind)地址更改回本地主机。例如:

 <bind-address>127.0.0.1</bind-address>

www.example.com.nginx.conf

server {
listen 80;
server_name www.example.com;
location /listen {
if ($ssl_protocol = "") {
rewrite ^ https://$server_name$request_uri? permanent;
}
}
}

#### SSL

server {
ssl on;
ssl_certificate_key /etc/sslmate/www.example.com.key;
ssl_certificate /etc/sslmate/www.example.com.chained.crt;

# Recommended security settings from https://wiki.mozilla.org/Security/Server_Side_TLS
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:
ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA
-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES2
56-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_prefer_server_ciphers on;
ssl_dhparam /usr/share/sslmate/dhparams/dh2048-group14.pem;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:5m;

# Enable this if you want HSTS (recommended)
add_header Strict-Transport-Security max-age=15768000;
listen 443 ssl;
server_name www.example.com;

location / {
proxy_pass http://127.0.0.1:8000/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

}

关于ssl - 为什么 Icecast2 不想通过 https 提供流?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30237748/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com