ePOS打印机的自签名证书¶
To work with Odoo, some printer models that can be used without an IoT box may require the HTTPS protocol to establish a secure connection between the browser and the printer. However, trying to reach the printer’s IP address using HTTPS leads to a warning page on most web browsers. In that case, you can temporarily force the connection, which allows you to reach the page in HTTPS and use the ePOS printer in Odoo as long as the browser window stays open.
警告
The connection is lost after closing the browser window. Therefore, this method should only be used as a workaround or as a pre-requisite for the following instructions.
Generate, export, and import self-signed certificates¶
For a long-term solution, you must generate a self-signed certificate. Then, export and import it into your browser.
重要
Generating an SSL certificate should only be done once. If you create another certificate, devices using the previous one will lose HTTPS access.
导航到 ePOS 的 IP 地址(例如,https://192.168.1.25
),点击 高级 和 转到 [IP 地址](不安全) 强制连接。
Then, sign in using your printer credentials to access the ePOS printer settings. To
sign in, enter epson
in the ID field and your printer serial number in the
Password field.
在:guilabel:身份验证`部分点击:guilabel:`证书列表
,然后点击:guilabel:创建
,生成新的**自签名证书**。通用名称 应自动填写。如果没有,请填写打印机 IP 地址编号。在 有效期间 字段中选择证书的有效期,点击 创建,然后点击 重设 或手动重启打印机。
自签名证书已生成。重新加载页面并点击:guilabel:`安全性`部分中的 SSL/TLS,以确保在:guilabel:`服务器证书`部分中,选择了正确的 自签名证书。
导出过程很大程度受 OS(操作系统)`和浏览器影响。首先,导航至其 IP 地址(例如 `https://192.168.1.25),在网页浏览器上访问 ePOS 打印机设置。然后,按照 生成自签名证书选项卡 中的说明,执行强制连接。
如果您使用的是**Google Chrome**,
click Not secure next to the search bar, and Certificate is not valid;
go to the Details tab and click Export;
add
.crt
at the end of the file name to ensure it has the correct extension;select Base64-encoded ASCII, single certificate, at the bottom of the pop-up window;
save, and the certificate is exported.
警告
确保证书以`.crt`扩展名结尾。否则,某些浏览器可能无法在导入过程中看到该文件。
如果您使用的是**Mozilla Firefox**,
click the lock-shaped icon on the left of the address bar;
go to
;
scroll down to the Miscellaneous section;
click PEM (cert) in the Download section;
save, and the certificate is exported.
The import process is heavily dependent on the OS and the browser.
Windows 10 manages certificates, which means that self-signed certificates must be imported from the certification file rather than the browser. To do so,
open the Windows File Explorer and locate the downloaded certification file;
right-click on the certification file and click Install Certificate;
select where to install the certificate and for whom - either for the Current User or all users (Local Machine). Then, click Next;
on the
Certificate Store
screen, tick Place all certificates in the following store, click Browse…, and select Trusted Root Certification Authorities;click Finish, accept the pop-up security window;
restart the computer to make sure that the changes are applied.
如果您使用的是**Google Chrome**,
open Chrome;
go to
;go to the Authorities tab, click Import, and select the exported certification file;
accept all warnings;
click ok;
restart your browser.
如果您使用的是**Mozilla Firefox**,
open Firefox;
go to
;select the exported certification file;
tick the checkboxes and validate;
restart your browser.
On Mac OS, you can secure the connection for all browsers by following these steps:
open Safari and navigate to your printer’s IP address. Doing so leads to a warning page;
on the warning page, go to
, validate;reboot the printer so you can use it with any other browser.
To generate and export an SSL certificate and send it to IOS devices, open Google Chrome or Mozilla Firefox. Then,
导航到 ePOS 的 IP 地址(例如,https://192.168.1.25
),点击 高级 和 转到 [IP 地址](不安全) 强制连接。
Then, sign in using your printer credentials to access the ePOS printer settings. To
sign in, enter epson
in the ID field and your printer serial number in the
Password field.
在:guilabel:身份验证`部分点击:guilabel:`证书列表
,然后点击:guilabel:创建
,生成新的**自签名证书**。通用名称 应自动填写。如果没有,请填写打印机 IP 地址编号。在 有效期间 字段中选择证书的有效期,点击 创建,然后点击 重设 或手动重启打印机。
自签名证书已生成。重新加载页面并点击:guilabel:`安全性`部分中的 SSL/TLS,以确保在:guilabel:`服务器证书`部分中,选择了正确的 自签名证书。
导出过程很大程度受 OS(操作系统)`和浏览器影响。首先,导航至其 IP 地址(例如 `https://192.168.1.25),在网页浏览器上访问 ePOS 打印机设置。然后,按照 生成自签名证书选项卡 中的说明,执行强制连接。
如果您使用的是**Google Chrome**,
click Not secure next to the search bar, and Certificate is not valid;
go to the Details tab and click Export;
add
.crt
at the end of the file name to ensure it has the correct extension;select Base64-encoded ASCII, single certificate, at the bottom of the pop-up window;
save, and the certificate is exported.
警告
Make sure that the certificate ends with the extension .crt
. Otherwise, some
browsers might not find the file during the import process.
如果您使用的是**Mozilla Firefox**,
click the lock-shaped icon on the left of the address bar;
go to
;scroll down to the Miscellaneous section;
click PEM (cert) in the Download section;
save, and the certificate is exported.
To import an SSL certificate into an Android device, first create and export it from a
computer. Next, transfer the .crt
file to the device using email, Bluetooth, or USB. Once
the file is on the device,
open the settings and search for
certificate
;click Certificate AC (Install from device storage);
select the certificate file to install it on the device.
注解
安装证书的具体步骤可能会因 Android 版本和设备制造商的不同而有所不同。
要将 SSL 证书导入 iOS 设备,请首先从计算机创建并导出它。然后,使用电子邮件、蓝牙或任何文件共享服务将`.crt`文件传输到设备。
下载此文件会触发警告弹出窗口。点击:guilabel:`允许`下载配置文件,然后关闭第二个弹出窗口。然后,
转到 iOS 设备上的 设置应用程序;
单击用户详细信息框下的 配置文件已下载;
找到下载的
.crt
文件并选择它;点击屏幕右上角的:guilabel:
安装
;如果设备上设置了密码,请输入密码;
点击证书警告屏幕和弹出窗口右上角的:guilabel:
安装
;点击 已完成。
证书已安装,但仍需要进行身份验证。步骤如下:
转到
;使用**滑动按钮**启用已安装的证书;
在弹出窗口中点击 继续。
重要
如果您需要从未提及的操作系统或网络浏览器导出 SSL 证书,请在您的首选搜索引擎中搜索
导出 SSL 证书
+您的浏览器或操作系统的名称
。同样,要从未提及的操作系统或浏览器导入 SSL 证书,请在您的首选搜索引擎中搜索
导入 SSL 证书根颁发机构
+您的浏览器或操作系统的名称
。
检查证书是否正确导入¶
要确认打印机的连接安全,请使用 HTTPS 连接到其 IP 地址。例如,在浏览器中导航到 https://192.168.1.25
。如果 SSL 证书已正确应用,您不应再看到警告页面,并且地址栏应显示挂锁图标,表明连接安全。