1

有两台服务器,我的开发服务器和当前安装了 Quick Books 的服务器。

这是我保存在 Quick Books 服务器上的 .QWC 文件。

<?xml version="1.0" encoding="utf-8"?>
<QBWCXML>
<AppName>QBWebService</AppName>
<AppID></AppID>
<AppURL>https://<url>/soap.js</AppURL>
<AppDescription>This is The App</AppDescription>
<AppSupport>https://<url></AppSupport>
<UserName>User</UserName>
<OwnerID>{GUID}</OwnerID>
<FileID>{GUID}</FileID>
<QBType>QBFS</QBType>
</QBWCXML>

这在我的开发服务器上的 soap.js 文件中的代码下方。

var soap    = require('soap'),
    fs      = require('fs'),
    xml     = fs.readFileSync('wsdl.wsdl', 'utf8'),
    https   = require('https'),
    options = {
               key: fs.readFileSync('/path/to/key'),
               cert: fs.readFileSync('/path/to/crt'),
               ca: [
                    fs.readFileSync('/path/to/crt', 'utf8'),
                    fs.readFileSync('/path/to/crt', 'utf8'),
                    fs.readFileSync('/path/to/crt', 'utf8')
                   ]
              };
var server = https.createServer(options, function(request, response) {
            response.end("404: Not Found: " + request.url);
});

var myService = {
       'QBWebConnectorSvc': {
           'QBWebConnectorSvcSoap': {
               authenticate: function(args) {
                  return {
                      authenticateResult: { string: [guid(), {}]} 
                };
            }
        }
    }
};
server.listen(443, function() {
    console.log('Listening Jimbo');
});
soap.listen(server, '/wsdl', myService, xml);
var thisUrl = './wsdl/wsdl.wsdl';
soap.createClient(thisUrl, function(err, client) {
    if(err) {
        console.log('Error soap create client:');
        console.log(err);
    }
    else {
        console.log('In soap create client else');
        console.log('Client:');
        console.log(client);
        console.log('This should be describe');
        client.setSecurity(new soap.ClientSSLSecurity('/Path/to/Server/key', '/path/to/server/crt', function(err, secure) {
            if(err) {
                console.log('Error Not Secure:');
            }
            else {
                console.log('Secure');
                console.log(secure);
                client.QBWebConnectorSvc.QBWebConnectorSvcSoap.authenticate(function(err, done) {
                    if(err) {
                        console.log('Err Auth:');
                        console.log(err);
                    }
                    else {
                        console.log('Auth Done:');
                        console.log(done);
                    }
                });
            }
        }));

问题是 Web 连接器一直说它无法验证我的证书,“QBWC1048:QuickBooks Web 连接器无法验证 Web 应用程序服务器证书。”。我知道证书很好,并且两台计算机之间的防火墙是打开的。

以下来自 WebConnector 日志文件。

> 20160906.20:29:30 UTC : QBWebConnector.WebServiceManager.ReadQWC(QWCReader QWC) : Parsing application configuration xml file to load its content to variables
20160906.20:29:51 UTC   :  : QBWC1048: QuickBooks Web Connector could not verify the web application server certificate.Certificate URL:https://<url>/soap.jsStackTrace:at System.Net.HttpWebRequest.GetResponse()
at QBWebConnector.QWCReader.CheckCertURL()Message (description of theexception):Unable to connect to the remote server Source (name of application or object that caused the exception):SystemTargetSite (method that threw the exception):System.Net.WebResponse GetResponse()InnerException:System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <IP>:443
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
atSystem.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state,IAsyncResult asyncResult, Exception& exception)
20160906.20:29:58 UTC   :QBWebConnector.WebServiceManager.ReadQWC(QWCReader QWC) : QBWC1048: QuickBooks Web Connector could not verify the web application server certificate.
QBWC1051: The new application was not added
20160906.20:29:58 UTC   :  : ~SingleInstanceHandler() - usingInstanceChannel = false. Returning without any Registry key delete or unmarshalling.

如果您需要更多信息,请询问。

任何帮助将非常感激。谢谢你。

4

0 回答 0