早上好,
我有一个问题,我想在我的 API 和我的服务器之间建立一个 HTTPS 连接。我将 Dart 与 Redstone Dart 层一起使用。我所有的证书都经过验证。
我使用 RedStone 函数的:start(); 建立这种联系。
但是在连接过程中出现错误。
信息:2016-01-25 02:26:09.789:使用带有选项的安全连接:{Symbol("certificateName"): CN=RedStone, Symbol("context"): '_SecurityContext'} 的实例
未处理的异常:参数不匹配的闭包调用:函数“调用”
NoSuchMethodError:传递给名为“call”的方法的参数数量不正确接收方:关闭:(动态,int,SecurityContext,{backlog:int,v6Only:bool,requestClientCertificate:bool,shared:bool})=>Future from Function 'bindSecure' : 静止的。尝试调用:调用(“0.0.0.0”,9000,证书名称:“CN = RedStone”,上下文:'_SecurityContext'的实例,共享:false)找到:调用(地址,端口,上下文,积压,v6Only,requestClientCertificate,共享) »
这是我的代码片段:
SecurityContext serverContext = new SecurityContext()
..useCertificateChain(localFile('certificates/server_chain.pem'))
..usePrivateKey(localFile('certificates/server_key.pem'),
password: 'test');
var secureOptions = {#certificateName: "CN=RedStone", #context: serverContext};
app.setupConsoleLog(Level.INFO);
app.start(port:9000, secureOptions: secureOptions);
我已经输入了正确的参数,但我不明白为什么它仍然给我一个错误。
如果有人,可以帮助我吗?
谢谢