Hi
I am trying to use my own trusted Certificate but it seems i can't load it
1. Here is code:
<script type="text/javascript">
qz.security.setCertificatePromise(function(resolve, reject) {
//Preferred method - from server
$.ajax("qz20/nmbm_bundle.crt").then(resolve, reject);
});
qz.security.setSignaturePromise(function(toSign) {
return function(resolve, reject) {
//Preferred method - from server
$.ajax("sign-message.php?request=" + toSign).then(resolve, reject);
};
});
qz.websocket.connect().then(function() {
return qz.printers.find("Talao") // Pass the printer name into the next Promise
}).then(function(printer) {
var config = qz.configs.create(printer); // Create a default config for the found printer
var data = [{type: 'raw', data: '<?php echo $POSPrint;?>'}]; // Raw ZPL
return qz.print(config, data);
}).catch(function(e) { console.error(e); });
</script>
2. The certifcate conntent (can i upload it?)
3. Here's the result in console:
[INFO] 2017-05-02 18:37:20,364 @ qz.ws.PrintSocketClient:?
Connection opened from /0:0:0:0:0:0:0:1:58916 on socket port 8182
[DEBUG] 2017-05-02 18:37:20,411 @ qz.ws.PrintSocketClient:?
Message: {"certificate":{"description":"'$' nï¿£o estï¿¡ definido","number":-
2146823279,"stack":"ReferenceError: '$' nï¿£o estï¿¡ definido\n at Anonymous function (
http://dev.nmbm.biz/npos/LAB-pos_print.php?mc_id=27:37:5)\n at lib$rsvp$$internal$$initializePromise (
http://dev.nmbm.biz/npos/qz20/dependencies/rsvp-3.1.0.min.js:10:9164)\n at lib$rsvp$promise$$Promise (
http://dev.nmbm.biz/npos/qz20/dependencies/rsvp-3.1.0.min.js:10:14801)\n at _qz.tools.promise (
http://dev.nmbm.biz/npos/qz20/qz-tray.js:442:17)\n at _qz.security.callCert (
http://dev.nmbm.biz/npos/qz20/qz-tray.js:427:17)\n at _qz.websocket.setup.openConnection (
http://dev.nmbm.biz/npos/qz20/qz-tray.js:289:21)\n at _qz.websocket.connection.onopen (
http://dev.nmbm.biz/npos/qz20/qz-tray.js:122:29)"},"promise":{},"timestamp":1493746640412,"uid":"3ri2ym"}
[INFO] 2017-05-02 18:37:36,991 @ qz.common.TrayManager:?
Allowed An anonymous request to connect to QZ
Thank you for your help