我可以将 HTTPS 客户端证书身份验证与 HTTPS 触发的Google Cloud Functions 结合使用吗?
我独立node.js,我会尝试一些类似这样的:
var https = require('https');
var options = {requestCert: true, rejectUnauthorized: true};
https.createServer(options, function (req, res) {
// ...
}).listen(1234);
Run Code Online (Sandbox Code Playgroud)
但是由于 Google Cloud Functions(大概)控制着node.js服务器的创建,我目前不清楚如何传递所需的选项。
Google 提供了有关如何使用 (OAuth 2.0) 服务帐户和访问令牌进行身份验证的文档,但我对 HTTPS 客户端证书感兴趣,例如 Web 浏览器也可以提供。
https node.js google-cloud-functions ssl-client-authentication
我有我的 .NET 客户端(Windows 服务),它订阅了 Salesforce 流 API 推送主题。
我能够连接到 Salesforce 并且可以将通知发送给我的客户。一切正常,但是:
如果我更新对象一段时间(可能是 2 小时)后通道上没有活动(Salesforce 对象没有更改),我将不会收到来自 Salesforce 的任何通知。
我曾尝试让听众登录,并在下面说的日志中
{"clientId":"f6xo67iet55w5j7ek6ldw72nfc6","channel":"/meta/connect","id":"82","successful":true} 5/15/2018 8:12:28 PM
{"advice":{"interval":0,"reconnect":"handshake"},"channel":"/meta/connect","id":"83","error":"403::Unknown client ","successful":false} 2018 年 5 月 15 日下午 8:12:28
{"clientId":"hbx1v2cxebbeder11s99dqkxmasre","advice":{"interval":0,"timeout":110000,"reconnect":"retry"},"channel":"/meta/connect","id": "85","successful":true} 5/15/2018 晚上 8:12:29
{"clientId":"hbx1v2cxebbeder11s99dqkxmasre","channel":"/meta/connect","id":"86","successful":true} 5/15/2018 8:14:20 PM
{"clientId":"hbx1v2cxebbeder11s99dqkxmasre","channel":"/meta/connect","id":"87","successful":true} 5/15/2018 8:16:10 PM
所以根据日志,有时我会收到“403::Unknown client”,但紧接着它又说通道成功。
但正如我所说,当我在 2 小时后尝试更新 Salesforce 对象时(根据日志,它连接成功)我没有收到任何通知。
如果我重新启动 Windows 服务并再次收到通知。
在我的客户中,我使用的是来自 - https://github.com/couchand/CometD.NET/tree/headers 的Cometd ,对于推送主题订阅,我正在使用它 - https://github.com/foluis/Salesforce_PushTopics
任何帮助将不胜感激。
给定控制台日志输出,例如:
...
app.js:4408 update w/ model.location: Discovering
app.js:4408 update w/ action: Animate 911583 { width = 320, height = 480 }
app.js:4408 update w/ model.location: Discovering
app.js:4408 update w/ action: Animate 911609 { width = 320, height = 480 }
app.js:4922 some other log message
app.js:1923 yet another thing on the console
...
Run Code Online (Sandbox Code Playgroud)
是否可以让Chrome删除包含"Animate"一词的所有行?
我试过在Chrome中使用负面的前瞻 :( .*(?!Animate).*另请参阅:如何否定正则表达式中的特定单词?),没有运气.
但它对Chrome没有任何影响:
能够只输入"!Animate"或"Animate"[x]否定过滤器会很棒.这是可能的,或者任何人都可以在这种情况下使用否定正则表达式?
谢谢.