Unity报错:InvalidOperationException: Insecure connection not allowed的解决方法

问题描述

在导入Steam VR 插件后报错:

InvalidOperationException: Insecure connection not allowed
UnityEngine.Networking.UnityWebRequest.SendWebRequest () (at <4139bb31c03640e7b650db6ec39d5754>:0)
UnityEngine.WWW..ctor (System.String url) (at <384e0fe1666848ef9ddc0b495902df33>:0)
Valve.VR.SteamVR_Update.Update () (at Assets/SteamVR/Editor/SteamVR_Update.cs:42)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <7b4f3dc961684c98b64a8a94a10cd68d>:0)

原因分析

该错误是由于新版本的Unity默认是不允许HTTP请求的

问题解决

点击Edit->Project Settings…,选中Player,在Other Settings中找到Allow downloads over HTTP*,修改其访问权限为Always allowed即可。

后记

选择Always allowed,会弹出一个警告:

 Plain text HTTP connections are not secure and can make your application vulnerable to attacks. 

(释义:纯文本HTTP连接不安全,可能会使您的应用程序容易受到攻击。)

备注:如果你是用的接口地址使用的都是Https,建议选择第二个,仅仅在开发环境使用http。如果你的接口地址存在Http协议,建议选择Always allowed,否则在发布后,接口可能会不通。

相关推荐

  1. opencv一些解决方案

    2024-01-04 14:14:02       32 阅读
  2. Nginx 504 Gateway Time-out 解决方法

    2024-01-04 14:14:02       19 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-04 14:14:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-04 14:14:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-04 14:14:02       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-04 14:14:02       20 阅读

热门阅读

  1. 记 -bash: docker-compose: command not found 的问题解决

    2024-01-04 14:14:02       39 阅读
  2. Unity Hub 无法激活许可证

    2024-01-04 14:14:02       39 阅读
  3. NCC开发记录

    2024-01-04 14:14:02       42 阅读
  4. SQL WHERE 语句(条件选择)

    2024-01-04 14:14:02       38 阅读
  5. Redis缓存击穿、缓存雪崩、缓存穿透

    2024-01-04 14:14:02       33 阅读
  6. SSD的控制器架构

    2024-01-04 14:14:02       37 阅读
  7. Android 使用 retrofit2 解析XML响应

    2024-01-04 14:14:02       40 阅读