问题描述
使用Cordova 5.1.1和Apache Ripple 0.9.32时遇到问题。我试图连接到使用IIS Express和自签名SSL证书在Visual Studio 2013中调试运行的C#Web API 2 Web服务。
I am experiencing a problem using Cordova 5.1.1 and Apache Ripple 0.9.32. I am trying to connect to a C# Web API 2 web service running in debug in Visual Studio 2013 using IIS Express and a self signed SSL certificate.
Ripple,正在运行对默认代理,报告
Ripple, which is running on the default proxy of http://localhost:4400, reports
INFO: Proxying cross origin XMLHttpRequest - https://localhost:44300/api/account/login
ERROR: Proxying failed with: [Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE]
当我调试web服务没有SSL一切正常。
When I debug the web service without SSL everything works correctly.
任何人都可以忽略这个问题,或者我需要从授权机构获得SSL证书吗?
Can anyone shed any light on this, or will I need to get an SSL certificate from an authority?
我知道这可能与。
推荐答案
我想出了一个现在已经足够好的解决方法。
I've come up with a workaround which is good enough for now.
- 使用--disable-web-security标志设置运行Chrome的快捷方式。有关详细信息,请参阅我的答案
- 使用命令行或Visual Studio启动Ripple
- 启动Chrome实例
- 浏览到您的Ripple网址并通过HTTPS发出您的请求
- 这将失败,开发工具控制台将显示 POST net :: ERR_INSECURE_RESPONSE
- 在新标签中,浏览到您的网址
- 这将导致您的连接不是私人网页。点击高级,然后点击继续(不安全)接受自我签署的SSL
- 现在返回Ripple标签页,尝试再次发出您的请求,它应该会成功。
- Create a shortcut to run Chrome with the --disable-web-security flag set. For further information see my answer at Visual Studio, Ripple Emulator and CORS/Cross Domain Ajax
- Start Ripple using either the command line or Visual Studio
- Start an instance of Chrome using the shortcut from 1.
- Browse to your Ripple url and issue your request over HTTPS
- This will fail and the dev tools console will show POST https://mydomain:port/api_endpoint net::ERR_INSECURE_RESPONSE
- In a new tab browse to your https://mydomain:port url
- This will result in a "Your connection is not private" web page. Click on "Advanced", and then on "Proceed to https://mydomain:port (unsafe)" to accept the self signed SSL
- Now back on the Ripple tab try issuing your request again and it should succeed.
这篇关于使用带有自签名SSL证书的Apache Ripple仿真器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!