https://blog.didierstevens.com/2015/03/30/howto-make-your-own-cert-with-openssl-on-windows/
The only way in which I've deviated was to use 2048 bit instead of 4096, per your docs.
I launch QZ Tray with -DtrustedRootCert pointing to the ca.crt file generated by OpenSSL.
I have tested using both the ca.crt/ca.key and the ia.crt/ia.key files but I believe I still have a signing issue. I do get my certificate to show up in Site Manager after allowing it once and remembering that. It shows up with a Fingerprint.
I'm using the sign-message.php script via ajax, and I'm confirming that it is returning a signature, but I'm assuming somehow it isn't the correct signature. My app does NOT show any of the java alerts, however nothing prints. It seems to hang, when I give up and try to leave my page I get the error "connection closed before response received."
Any insight on this? Is it possible I need to use any different parameters on the OpenSSL steps?
Thanks!
Maybe this needs some modification to work with signed messages?
I had connectAndPrint working with the prompts.
The signature promise and cert promise calls must be first.
Not sure why base64 is returned but hangs on your page. Can you modify sample.html and see if it happens there too?
--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Putting the list back on CC.
No, connectAndPrint cannot be used in that manner.The purpose of connectAndPrint was to illustrate how a asynchronous promise chain can be implemented.By injecting an asynchronous process (ajax) into the mix, you've broken it.The general design is:Promise()
.then(promise)
.then(promise)
.then(...)Generally speaking, $.ajax implements the Promise interface "well enough".var config = "qz.configs.create("zebra zp 500 (zpl)");qz.websocket.connect()
.then($.ajax("/my/url1/..."))
.then(function(data) {
qz.print(, data);})
.then($.ajax("/my/url2/..."))
.then(function(data) {
qz.print("qz.configs.create("zebra zp 500 (zpl)"), data);})
.catch(function(err) {
console.error(err);
});If you are unsure about how many times you will be calling $.ajax, we recommend you use a custom Promise job instead. Here's a sample:
On Wed, Aug 10, 2016 at 4:13 PM, Chris Edwards <ch...@cledwards.net> wrote:I don’t know if this is a factor, but I make an ajax call that retrieves ZPL, and then I’m trying to send that to the printer. So it results in 2 ajax calls in a row. I have this stripped down to the basics:
· qz.security.setCertificatePromise
· qz.security.setSignaturePromise
· qz.websocket.connect();
This is all on the page load, and seems to work, the log shows “allowed My Cert Name to connect to QZ”
Then this function:
function printLabel(zpl) {
var printer = "zebra zp 500 (zpl)";
var config = qz.configs.create(printer);
var data = [{ type: 'raw', data: zpl }];
qz.print(config, data);
}
I make my ajax call that returns ZPL then I call printLabel with response from that. My console shows my zpl ajax call, then the one to sign the message. Nothing appears on the QZ logs when I attempt to print. So this still may be something I’m missing on my end, it is possible I am oversimplifying and missing a critical step.
qz.websocket.connect()
.then($.ajax('/my/url?params'))
.then(function(data) {
console.log(data);
qz.print(qz.configs.create("zebra zp 500 (zpl)"), data);
})
.catch(function(err) {
console.error(err);
});
but "data" is undefined when it gets into the function. This is with jquery 1.11.3. The ajax call is being made but the response is not being passed along. My console shows Established Connection with QZ Tray and then TypeError: data is undefined. Can you tell what I'm missing?
Thanks,
Chris
$.post('/my/url', 'my=params', function(data) {
var zpl = [ data ];
qz.websocket.connect().then(function() {
qz.print(qz.configs.create("zebra zp 500 (zpl)"), zpl);
});
});