so I would have to do this to every local client of QZ Tray that I install?
I'm able to create a self-signed certificate through my Plesk panel that creates a "private key (*.key)" and a "certificate (*.crt)" files, but I'm not sure what exactly I need to do
--
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.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
qz.security.setCertificatePromise(function(resolve, reject) {
//Preferred method - from server
$.ajax("/var/www/vhosts/domain.com/httpdocs/qz/certificate.cer").then(resolve, reject);qz.security.setSignaturePromise(function(toSign) {
return function(resolve, reject) {
//Preferred method - from server
$.ajax("/var/www/vhosts/domain.com/httpdocs/qz/sign-message.php?request=" + toSign).then(resolve, reject);/var/www/vhosts/domain.com/httpdocs/qz/private-key.pem
d. Then we would use "qz.websocket.connect" to connect the website/browser to the local PC copy of QZ Tray?To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodesTo unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.
In this section, I see you list the "certificate" and "intermediate certificate"; is it necessary to include the "intermediate certificate"?
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.
1. I'm trying to better understand what "authcert.override={certificate_name}.crt" actually does? Does this suppress the "localhost wants to connect to QZ..." pop-up or is it suppressing the "localhost wants to print/access..." pop-up messages?
2. When I add the above to my client "qz-tray.properties" file, do I also have to have my "{certificate_name}.crt" file saved in the "C:\Program Files\QZ Tray\" directory too?
3. In the "sample.html" page, I notice for the "localhost wants to print/access..." pop-up messages, when I click on "Remember my decision" the "Allowed" button gets greyed out; is this happening because in the "sample.html" file you use the "alternate method - unsigned" method for "setSignaturePromise"?
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.
> is this happening because in the "sample.html" file you use the "alternate method - unsigned" method for "setSignaturePromise"?
qz.security.setSignaturePromise(function(toSign) {
return function(resolve, reject) {
//Preferred method - from server
$.ajax("xampp/htdocs/qz_tray/demo/assets/signing/sign-message.php?request=" + toSign).then(resolve, reject);
//Alternate method - unsigned
//resolve();
};
});// Sample key. Replace with one used for CSR generation
$KEY = 'private-key.pem';
$req = $_GET['request'];
$privateKey = openssl_get_privatekey(file_get_contents($KEY));wss.alias=qz-tray
wss.keystore=C:\\Program Files\\QZ Tray\\auth\\qz-tray.jks
wss.keypass=1ab0l2j9tc
wss.storepass=1ab0l2j9tc
wss.host=0.0.0.0
authcert.override=certificate.crt2017-01-26 17:10:19,619 [INFO] Allowed OVH to connect to QZ
2017-01-26 17:10:22,969 [INFO] Connection closed: 1001 - null
2017-01-26 17:10:22,969 [INFO] Closing all communication channels for OVH
2017-01-26 17:10:23,860 [INFO] Connection opened from /0:0:0:0:0:0:0:1:49841 on socket port 8182
2017-01-26 17:10:23,917 [DEBUG] Message: {"certificate":"-----BEGIN CERTIFICATE----------END CERTIFICATE-----\n","promise":{},"timestamp":1485468623889,"uid":"x32t85"}
2017-01-26 17:10:23,932 [WARN] Problem verifying certificate with CRL
So symmarizing everything in one place:
1) generate your private key and certificate by running command like this:
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3650 -nodes
You have either to install openssl for windows or cygwin or just use linux system.
Finally you'll have 2 files:
key.pem - which is private key
and cert.pem - which I guess is public certificate (you can rename it to cert.pem.crt and see its details by windows certificate viewer)
2) Either compile your own build
https://qz.io/wiki/compiling using your certificate cert.pem.crt
The final build command is
ant nsis -Dauthcert.use=ant/cert/cert.pem.crt (place your certificate in appropriate folder)
OR
run your existing installed QzTray using your certificate (using bat file)
javaw -DtrustedRootCert=D:\projects\cert.pem.crt -jar "d:\Install\Progs\Qz\qz-tray.jar"
3) Using qz demo samples - update setCertificatePromise
with something like this
$.ajax("http://domian.dev/qz/certificate.cer").then(resolve, reject);
or $.ajax("http://domian.dev/qz/certificate.cer.txt").then(resolve, reject);
and make sure the web url is accessible as direct link ( http://domian.dev/qz/certificate.cer.txt )
4) Update setSignaturePromise with
$.ajax(" http://domian.dev/qz/sign-message.php?request=" + toSign).then(resolve, reject);
In sign-message.php
use your private.key you've generated at step 1
$KEY = 'key.pem'; // for your security place the private key in non-accessible directory from web
$PASS = '';
$req = $_GET['request'];
$privateKey = openssl_get_privatekey(file_get_contents($KEY), $PASS);
//.........
That's it, if you configured everything properly , you'll be able to remember your allowed choice in popup window.
Hi, I tried this getting no PopUP, but nothing printing. If i remove Cert.cer then getting pop up and able to print.
qz.security.setCertificatePromise() and
qz.security.setSignaturePromise() defined once and only once. Sometimes people forget to comment-out the one bundled with sample.html when integrating with a separate JS file.