About Mobility Print and Certificates
By default, the Mobility Print server will use a self-signed certificate. While the self-signed certificate secures communication, using one means that users browsing to the Mobility Print Help Center on your server using HTTPS will see an untrusted certificate error 1 .
If this worries you, however, there are two different solutions.
-
Consider sharing the link with your users instead to our Mobility Print Help Center which shows users how they can use Mobility Print on their devices. Our public page uses a trusted certificate that’s securely reachable over port
443
. -
It is also possible to install a custom certificate on your Mobility Print server, which allows admins and users to access the web interface of the server with HTTPS without facing a certificate error. Below we describe two different ways to create the certificate files and install them on the Mobility Print server using either Keystore Explorer or OpenSSL.
-
What is PEM Format?
PEM or Privacy Enhanced Mail is a Base64 encoded DER certificate. PEM certificates are frequently used for web servers as they can easily be translated into readable data using a simple text editor. Generally when a PEM encoded file is opened in a text editor, it contains very distinct headers and footers. Below are some examples of different files in PEM format.
-----BEGIN CERTIFICATE REQUEST----- MIIB9TCCAWACAQAwgbgxGTAXBgNVBAoMEFF1b1ZhZGlzIExpbWl0ZWQxHDAaBgNV BAsME0RvY3VtZW50IERlcGFydG1lbnQxOTA3BgNVBAMMMFdoeSBhcmUgeW91IGRl Y29kaW5nIG1lPyAgVGhpcyBpcyBvbmx5IGEgdGVzdCEhITERMA8GA1UEBwwISGFt aWx0b24xETAPBgNVBAgMCFBlbWJyb2tlMQswCQYDVQQGEwJCTTEPMA0GCSqGSIb3 DQEJARYAMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCJ9WRanG/fUvcfKiGl EL4aRLjGt537mZ28UU9/3eiJeJznNSOuNLnF+hmabAu7H0LT4K7EdqfF+XUZW/2j RKRYcvOUDGF9A7OjW7UfKk1In3+6QDCi7X34RE161jqoaJjrm/T18TOKcgkkhRzE apQnIDm0Ea/HVzX/PiSOGuertwIDAQABMAsGCSqGSIb3DQEBBQOBgQBzMJdAV4QP Awel8LzGx5uMOshezF/KfP67wJ93UW+N7zXY6AwPgoLj4Kjw+WtU684JL8Dtr9FX ozakE+8p06BpxegR4BR3FMHf6p+0jQxUEAkAyb/mVgm66TyghDGC6/YkiKoZptXQ 98TwDIK/39WEB/V607As+KoYazQG8drorw== -----END CERTIFICATE REQUEST-----
Above is the example of a CSR (certificate signing request) in PEM format. You can see that PEM has the characteristics of containing a header, the body (which consists mainly of code) and footer. The header and footer is what identifies the type of file, however, be aware that not all PEM files necessarily need them.\
-----BEGIN CERTIFICATE REQUEST----- and -----END CERTIFICATE REQUEST----- show a CSR in PEM format -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- show a private key in PEM format -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- show a certificate file in PEM format
Common Situations
-
I already have my
certificate.crt
,priv.pem
, & additional.crt
’s -
I have an encrypted
.p12
/.pfx
file already - I want to use a certificate from my Server’s Certificate Store
- I want to use the certificate that my PaperCut App server is using
I already have my certificate.crt
, priv.pem
, & additional .crt
’s
If you have more than one certificate, we’ll need to combine them into one certificate file. The private key can sit this one out!
-
Create a new text file with the name and extension as
tls.crt
Example:
certificate_chain.crt
-
In your new
tls.crt
file, stack all 3 certificates -one after the other and save the file -
The order of the certificates starts from the domain and up towards the root
- Domain certificate
- Intermediate certificate 1 above domain
- Intermediate certificate 2 above that (rinse, wash, repeat)
- Root certificate
-
You must include all certificates up to and including root.
Example of merging certificates:
-----BEGIN CERTIFICATE----- MIIGvTCCBaWgAwIBAgIQBsyeRo2C7ECRbEpmpu+mazANBgkqhkiG9w0BAQUFADBI . . . MDEyMDAwMFowgYcxCzAJBgNVBAYTAlVTMREwDwYDVQQIEwhNYXJ5bGFuZDESMBAG v+PMGxmcJcqnBrJT3yOyzxIZow== -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIIEjzCCA3egAwIBAgIQBp4dt3/PHfupevXlyaJANzANBgkqhkiG9w0BAQUFADBh . . . slXkLGtB8L5cRspKKaBIXiDSRf8F3jSvcEuBOeLKB1d8tjHcISnivpcOd5AUUUDh v+PMGxmcJcqnBrJT3yOyzxIZow== -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh . . . CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= -----END CERTIFICATE----
-
Once you have your new
tls.crt
, copy it and yourtls.pem
I have an encrypted .p12/.pfx file already
The certificate and private key used by the PaperCut Mobility Print server for SSL connections are encoded in PEM format (.crt
,.cer
,.pem
) and not a certificate archive (.p12
/.pfx
).
-
Export the existing certificate archive and private key (security-risk) 2 to PEM-encoded format via OpenSSL
[Export the private key from the encrypted certificate]
openssl pkcs12 -in mycert.pfx -nocerts -out priv.pem
[Remove the Passphrase]
openssl rsa -in priv.pem -out priv-unlocked.pem
[Export the certificate from the encrypted certificate bundle]
openssl pkcs12 -in certname.pfx -nokeys -out certificate.cer
I want to use a certificate from my Server’s Certificate Store
The process depends on the type of OS you have, we’ll provide our two most common server OS’ 3 .
Windows Certificate Store
- Export the certificate and key as a
.pfx
archive- Skip this step if you already have a
.pfx
file - Check out our knowledge base article Export the existing trusted certificate and key on how to do this
- Skip this step if you already have a
- Export the PEM-encoded key and certificate as described in I have an encrypted .p12/.pfx file already
macOS
- Open
Keychain Access
on your macOS system - Find your desired certificate under
System
- Right-click your certifcate > Select
Export
- If you opt to utilize an export password, notate this information securely
- Export the PEM-encoded key and certificate as described below.
Utilize the certificate the PaperCut App server is using
You may already be familiar with Keystore Explorer if you followed our guide Installing an SSL Certificate the Easy Way . You might be able to reuse that certificate if:
- Mobility Print is installed on the same server where PaperCut is running.
- You have a wildcard certificate, which should be valid for any server with the same domain name.
If either apply, follow these steps:
-
Open the Keystore used by the PaperCut App server with Keystore Explorer .
-
Select
Open an existing KeyStore
, navigate to your custom keystore within the App ServerExample KeyStore path:
[app-data]/PaperCut <Product>/server/custom/myfavoritekeystore
-
Right-Click on the entry for the certificate
- Select
Export
->Export Certificate Chain
. - Set the
Export Length
option toHead Only
- Change the filename to
tls.cer
- Select
Export
- Select
-
Right-Click on the entry for the certificate
- Select
Export
->Export Private Key
. - Select
OpenSSL
as thePrivate Key Type
. - Uncheck
Encrypt
and rename the file totls.pem
- Select
Export
- Select
Configure the PaperCut Mobility Print Server certificate
-
Stop the PaperCut Mobility Print service (
pc-mobility-print
) -
Navigate to your PaperCut Mobility Print data folder and locate your default certificate and private key
[[app-data]/PaperCut Mobility Print/data/] - tls.cer - tls.pem
-
Backup the existing
tls.pem
andtls.cer
files by appending the filename with.bak
. -
Copy your new
tls.pem
andtls.cer
files to the data folder -
Ensure to rename your files to the following, otherwise Mobility Print will fail to start!
- tls.cer - tls.pem
-
Restart the Mobility Print Server’s Operating System or restart the service .
-
Navigate to the web interface of the Mobility Print server using https://
<yourmobilityservername>
:9164/ to test the new certificate. -
Lastly, we recommend setting the
AccessibleIP
address configuration key . You’ll want to set this to theCommon Name (CN)
orSubject Area Name (SAN)
on your certificate.- Why? Mobility Print uses this value in a few different areas to advertise it’s address. Utilizing this setting will prevent some situations where users get a certificate error in the browser because they accessed the server by IP address and not hostname
Supported certificate and private key formats
As of Mobility Print Server version v1.0.3103 , Mobility Print supports certificates with a variety of key formats 4 .
- The certificate and private key need to be encoded in PEM format
- The keys cannot be password encrypted
- PKCS#8 private keys
- based on
RSA
orEC
- typically contain the
-----BEGIN PRIVATE KEY-----
header
- based on
- PKCS#1 private keys
RSA
keys- typically contain the
-----BEGIN RSA PRIVATE KEY-----
header
- Private keys based on Elliptic Cryptography (
EC
)- typically contain the
-----BEGIN EC PRIVATE KEY-----
header
- typically contain the
- PEM key data can contain PEM parameter blocks
- i.e.
-----BEGIN EC PARAMETERS-----
- i.e.
Still have questions?
Let us know! We’d be happy to chat about how Mobility Print works.
Feel free to leave a comment or question by visiting our
Support Portal
!
Also, check out the
Mobility Print Help Center
❤️
Appendix
1 It’s important to point out that, generally, this isn’t a problem. Users aren’t exchanging their credentials with the Mobility Print server through the web interface, and admins can simply click through the certificate error to get to the login page of the server and the traffic will still be encrypted.
2 Please note, performing step #1 will output your files into a readable format, keep these files safe like real keys!
3 To expose the certificate(s) within the archive, you’ll need the original archive’s (.p12/.pfx) password.
4 Prior to v1.0.3103 the private key format was limited and we have heard of customers following these instructions only to discover that when they try to print from Chromebooks, users will see an error in the browser: “Printing failed. Please check your printer and try again.” If that is happening, then these log messages should be present in the Mobility Print Server logs :
2020/07/16 09:39:40 mobility-print.exe: STDOUT|ERROR: Requested to decrypt but private key is not present {"src":"cert.go:161"}
2020/07/16 09:39:40 mobility-print.exe: STDOUT|ERROR: Error decrypting document name, err=private key not found {"src":"chrome_encryption.go:99"}
2020/07/16 09:39:40 mobility-print.exe: STDOUT|ERROR: Failed to decrypt document: {"client":"chrome","err":{}} {"src":"printing.go:133"}
This has been observed when the private key is not correctly formatted for Mobility Print. A temporary solution is to revert back to using the default self-signed certificate bundled with Mobility Print.
Comments