【发布时间】:2018-04-15 03:57:26
【问题描述】:
我正在使用 Azure 移动应用的 NotificationHubClient 进行呼叫,并使用 Firebase (gcm) 使用以下方法通知我的 Android 设备:SendGcmNativeNotificationAsync 呼叫。我遇到了异常:“底层连接已关闭:无法为 SSL/TLS 安全通道建立信任关系。”根据验证程序,远程证书无效
我的设置:
- 运行快速入门示例后端和 Xamarin 的 Azure 移动应用 表单移动应用
- 通知中心设置与 F1 免费层
- Quick Start 示例中的后端已修改为调用 WCF on 本地的另一台服务器。这目前由 TLS 证书保护
<bindings> <basicHttpBinding> <binding name="wsHttpBinding"> <security mode="Transport"> <transport clientCredentialType="Certificate" /> </security> </binding> </basicHttpBinding> </bindings>
- WCF 所需的自签名证书已上传到 移动应用,并设置为服务参考 rs:
rs.ClientCredentials.ClientCertificate.SetCertificate( StoreLocation.CurrentUser, StoreName.My, X509FindType.FindByThumbprint, "<thumbprintforthecertificate>");
- 此时,除了上面的 SendGcmNativeNotificationAsync 之外,一切都在工作,它只在我重新启动 Azure 移动应用程序后工作一次。之后它失败了,但出现了上述异常。
我搜索了 SO 和 Microsoft 文档,没有关于我的问题的问题或答案。
我尝试了什么:
- 在移动应用程序的应用程序设置中:清除 WEBSITE_LOAD_CERTIFICATES 的值。这适用于通知,但我的 WCF 调用失败
- tiagomtotti 尝试使用 FirebaseNet。这为我打开了其他错误 - nuget 依赖问题
- 在 resources.azure.com 中查找任何设置,但没有任何影响
是否有人在移动应用中使用证书并尝试运行通知时遇到错误?
【问题讨论】:
-
这不是问题。请参阅我对以下答案的评论
标签: wcf ssl-certificate firebase-cloud-messaging azure-mobile-services azure-notificationhub