qzind / qz-print

Archive for legacy qz-print versions (1.8, 1.9). See https://github.com/qzind/tray for modern versions.
Other
141 stars 101 forks source link

certificate signing not working for qz.printers calls #200

Closed jove4015 closed 6 years ago

jove4015 commented 6 years ago

I just purchased a full license for QZ Tray so we could get the certificate set up. I followed all the instructions and now we are no longer prompted to accept the certificate when first connecting. However, the second we try to list out the available printers or get the default printer (basically, anything under qz.printers()), we go back to having a certificate warning.

The code is like this:

            qz.security.setCertificatePromise(function(resolve, reject) {
                $.ajax({ url: "digital-certificate.txt", cache: false, dataType: "text" }).then(resolve, reject);
            });
            qz.security.setSignaturePromise(function(toSign) {
               return function(resolve, reject) {
                  $.post("sign-message.php", {request: toSign}).then(resolve, reject);
               };
            });         

            qz.websocket.connect().then(function() { // without certificate, we get prompted here
               showErrorMessage("Connected!");
               qz.printers.getDefault().then(function (e) { console.log(e); })   // with certificate, we get prompted here instead
            });

I need the certificate to stop all the dialogs, not just the first one. I don't see any additional instructions we haven't already followed. What am I missing?

lite1979 commented 6 years ago

@jove4015 Can you please send an email to support@qz.io so we can move the conversation off the public bug tracker?

I'll be happy to host a WebEx or TeamViewer session if needed; I'll be available at 5:30pm.

lite1979 commented 6 years ago

Please include QZ-Tray version, email or Product Key for the license, Java version, browser, and OS

jove4015 commented 6 years ago

Sorry guys, the problem ended up being with the sign-message script - somehow it managed to work for connect requests but no others. Will use the support email going forward - on your homepage it says to use the github issue tracker, I also found this odd :-)

lite1979 commented 6 years ago

Glad to you see you figured it out! :)

So that we can fix it moving forward, was it https://qz.io that directed you here, or this repo page https://github.com/qzind/qz-print ?

We develop against a new repo now, hence the question

https://github.com/qzind/tray

hugofabricio commented 5 years ago

How to solved? I have same problem.

tresf commented 5 years ago

Premium support can contact support@qz.io. We do not provide assistance with signing/licensing on our GitHub tracker.