2

I've build an intergration between our online software to Epson EPOS printers. (epos-2.22.0.js) I have successfully connected serveral printers such as tm-t88vi. I've solved much of the SSL problems with generating custom SSL certificates with OpenSSL and install them in the printer through EpsonNet Config. Then add the CA of the certificate in your browser, and https communication is up and running.Still there were some errors and no printing but another hour of googling lead me to this solution:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

to ensure all the insecure requests from the epson js libary are upgraded to secure requests, and our webapplication doesn't throw errors about insecure communication, and is printing!

But how different it is with the TM-P80. First problem i've ran in to, was that my custom certificate wasn't accepted by EsponNet Config. After hours of trying I figured out that it only accepts v1 ssl certificates (created with openssl-1.1). That gives me the gray lock (SSL ok) when opening the EpsonConfig page in Chrome. But still my application won't print with the error:

POST https://192.168.2.180/cgi-bin/epos/service.cgi?devid=local_printer&timeout=10000 net::ERR_EMPTY_RESPONSE

If I comment out the "upgrade-insecure-requests" tag, and accept insecure content on the page (Chrome setting) then the request goes to: (http instead of https)

 POST http://192.168.2.180/cgi-bin/epos/service.cgi?devid=local_printer&timeout=10000 

and the printer is printing, but the whole application is flagged as insecure. Another test: http://192.168.2.180/cgi-bin/epos/service.cgi returns a HTTP code 200 https://192.168.2.180/cgi-bin/epos/service.cgi returns a HTTP code 404

So to sum up:

  • code / certification works with other Epson ePOS printers fully SSL
  • certificate works on printer config page (https://192.168.2.180)
  • insecure requests to printer lets the printer print
  • secure requests are responded with an EMPTY_RESPONSE

Has anyone dealt with this exact problem, or has another idea to try ?

Thanks in advance for your reactions!

  • I do have a similar use-case where I want to print from a website served via HTTPS to a local EPSON printer (using `epos-2.22.0.js`). However, I'm getting CORS errors which I'm currently not able to fix. I wonder if you can elaborate on what you did in order to fix this? – Stone May 02 '23 at 14:12

1 Answers1

1

You should use port 8084 for https.

http  8008  
https 8043
Yunnosch
  • 26,130
  • 9
  • 42
  • 54
  • While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Mar 13 '23 at 12:35
  • Also your solution in prose seems not to match the code you show. Is there a typo? – Yunnosch Mar 13 '23 at 12:36