What is the problem with Websocket and Self-Signed SSL certificate(Websocket 和自签名 SSL 证书有什么问题)
问题描述
我有一个项目在 Intranet 上运行,所以我没有购买任何 SSL 证书或域名.相反,我创建了自签名证书.我有两层,其中一层是网络服务/websocket,另一层是视图.所有 https 连接一切正常,因此所有页面,但浏览器无法与 ws 或 wss 链接建立连接(已尝试端口 8443,443,8080).如果我使用 localhost 而不是我的 ip 编写链接,它可以完美运行,但是我无法从其他设备使用它.我将证书创建为 RSA/2048.我的项目在 Ubuntu 18.04 上运行.服务器端是用 Java-Spring Boot 编写的.
I have a project runs on intranet, so I didn't buy any SSL certificate or domain name. Instead, I created self-signed certificate. I have two layer one of which is web service/websocket and the other is view. Everything is OK for all https connections, hence all pages, but browser could not make connection with ws or wss links(was tried ports 8443,443,8080). If I write link with localhost instead of my ip, it works perfectly, but then I cannot use it from another device. I created certificete as RSA/2048. My project runs on Ubuntu 18.04. Serverside was written in Java-Spring Boot.
推荐答案
如果其他人需要答案,我从 这里.总而言之,问题出在Firefox,而不是其他浏览器.主要原因是火狐不接受wss链接的证书,其实第一个以https开头的链接也是同一个证书.解决方案是通过将 wss 转换为 https 并接受该链接的权限来转到以 wss 开头的链接,并且一切正常:)
If someone else need an answer, I got it from here. As summary, the problem is about Firefox, not about other browsers. Main reason is that Firefox do not accept certificate of wss link, in fact it is also the same certificate for the first connection link start with https. Solution is to go to the link started with wss by chancing wss to https and accept privilege of that link, and everthing works fine :)
这篇关于Websocket 和自签名 SSL 证书有什么问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Websocket 和自签名 SSL 证书有什么问题
基础教程推荐
- 如何对 HashSet 进行排序? 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01