Search code examples
zebra-printersnetwork-printers

Zebra ZD410 print from https


I'm trying to get my Zebra ZD410 to print labels from a website. That website is not mine. It runs on https. My printer does work, is connected to my computer, I can send ZPL instructions. The printer is actually connected to my Wi-Fi and has a static IP address of "192.168.2.80".

When browsing to "http://192.168.2.80" the print server page shows up.

The website in question supports, for now, only the Zebra 410 (and most probably other version, just not tested). Their instructions are to click on a link to accept the SSL certificate. Upon clicking on that link, a new page is opened and tries to load https://192.168.2.80, which is refused with "ERR_CONNECTION_REFUSED"

I have tried and successfully sent "!U1 setvar "ip.https.enable" "on" and restarted the printer, it doesn't change anything.


Solution

    • By default, the printer comes with http enabled
    • Always add a carriage return at the end of your commands in the communication tool
    • One can enable https by sending ! U1 setvar "ip.https.enable" "on"
    • The printer comes with no self-signed default certificate for SSL, that's a shame
    • Anybody can generate self-signed certificates, by opening a terminal and make sure you have openssl installed then type :
      • openssl genrsa 2048 > HTTPS_KEY.NRD
      • openssl req -new -x509 -nodes -sha256 -days 365 -key HTTPS_KEY.NRD > HTTPS_CERT.NRD
        • The certificate file must be named HTTPS_CERT.NRD
        • The private key file must be named HTTPS_KEY.NRD
    • Get both files EXACT byte sizes
    • Files must be manually uploaded in binary mode on the printer on E: (any other method will fail on ZD410, be it driver upload, serial upload, ftp upload, or setup utility upload, because the default destination is not E: but R: and is not RW)
      • Open Zebra setup utility
      • Open communication tools
      • Enter following commands
    ~DYE:HTTPS_CERT.nrd,B,NRD,REPLACE WITH FILE BYTE SIZE,,-----BEGIN CERTIFICATE-----
    REPLACE WITH YOUR CERTIFICATE CONTENT
    -----END CERTIFICATE-----
    ~DYE:HTTPS_KEY.nrd,B,NRD,REPLACE WITH FILE BYTE SIZE,,-----BEGIN PRIVATE KEY----- 
    REPLACE WITH YOUR KEY CNTENT
    -----END PRIVATE KEY-----
    ^XA
    ^JUS
    ^XZ
    ! U1 setvar "ip.https.enable" "on"
    ! U1 do "device.reset" ""
    

    Upon restart, one can check if the https webserver was enabled with a command:

    • ! U1 getvar "file.cert"
      • The printer will answer with all the loaded certificates.
      • Check the line with HTTPS service. It should have a file and a validity

    You can then navigate, on your browser to your printer's ip using https and also send https API triggers.

    If you wish to then turn off http, you can disable it by sending this command:

    ! U1 setvar "ip.http.enable" "off"