Certificate Management
| Document revision: | 2.3 (Fri Mar 05 13:58:17 GMT 2004) |
| Applies to: | V2.9 |
General Information
Summary
SSL (Secure Socket Layer) is a security technology to ensure encrypted transactions over a public network. To protect the data, an encryption key should be negotiated. SSL protocol is using Certificates to negotiate a key for data encryption.
Specifications
Packages required: systemLicense required: Level1
Submenu level: /certificate
Standards and Technologies: SSLv2, SSLv3, TLS
Hardware usage: high CPU usage
Description
SSL technology was first introduced by Netscape to ensure secure transactions between browsers and web servers. When a browser requests a secure web page (usually on TCP port 443), a web server first sends a Certificate, which contains a public key for the encryption key negotiation to take place. After the encryption key is negotiated, the web server will send the requested page encrypted using this key to the browser (and also the browser will be able to submit its data securely to the server)
SSL Certificate confirms the web server identity. The Certificate contains information about its holder (like DNS name and Country), issuer (the entity has signed the Certificate) and also the public key used to negotiate the encryption key. In order a Certificate to play its role, it should be signed by a third party (Certificate Authority) which both parties trust. Modern browsers that support SSL protocol have a list of the Certificate Authorities they trust (the most known and trusted CA is VeriSign, but that is not the only one)
To use a Certificate (which contain a public key), server needs a private key. One of the keys is used for encryption, and the other - for decryption. It is important to understand, that both keys can encrypt and decrypt, but what is encrypted by one of them can be decrypted only by the another. Private key must be kept securely, so that nobody else can get it and use this certificate. Usually private key is encrypted with a passphrase.
Most trusted Certificate Authorities sell the service of signing Certificates (Certificates also have a finite validity term, so you will have to pay regularly). It is also possible to create a self-signed Certificate (you can create one on most UNIX/Linux boxes using openssl toolkit; all Root Certificate Authorities have self-signed Certificates), but if it is not present in a browser's database, the browser will pop up a security warning, saying that the Certificate is not trusted (note also that most browsers support importing custom Certificates to their databases).
Certificates
Submenu level: /certificateDescription
MikroTik RouterOS can import Certificates for the SSL services it provides (only HotSpot for now). This submenu is used to manage Certificates for this services.
Property Description
name (name) - reference name subject (read-only: text) - holder (subject) of the certificate issuer (read-only: text) - issuer of the certificate serial-number (read-only: text) - serial number of the certificate invalid-before (read-only: date) - date the certificate is valid from invalid-after (read-only: date) - date the certificate is valid until ca (yes | no; default: yes) - whether the certificate is used for building or verifying certificate chains (as Certificate Authority)Command Description
import - install new certificatesNotes
Server certificates may have ca property set to no, but Certificate Authority certificates must have it set to yes
Certificates and encrypted private keys are imported from and exported to the router's FTP server. Public keys are not stored on a router in unencrypted form. Cached decrypted private keys are stored in encrypted form, using key that is derived from the router ID. Passphrases are not stored on router.
Configuration backup does not include cached decrypted private keys. After restoring backup all certificates with private keys must be decrypted again, using decrypt command with the correct passphrase.
No other certificate operations are possible while generating a key.
When making a certificate request, you may leave some of the fields empty. CA may reject your certificate request if some of these values are incorrect or missing, so please check what are the requirements of your CA
Example
To import a certificate and the respective private key already uploaded on the router:
[admin@MikroTik] certificate> import
passphrase: xxxx
certificates-imported: 1
private-keys-imported: 1
files-imported: 2
decryption-failures: 0
keys-with-no-certificate: 1
[admin@MikroTik] certificate> print
Flags: K - decrypted-private-key, Q - private-key, R - rsa, D - dsa
0 QR name="cert1" subject=C=LV,ST=.,O=.,CN=cert.test.mt.lv
issuer=C=LV,ST=.,O=.,CN=third serial-number="01"
invalid-before=sep/17/2003 11:56:19 invalid-after=sep/16/2004 11:56:19
ca=yes
[admin@MikroTik] certificate> decrypt
passphrase: xxxx
keys-decrypted: 1
[admin@MikroTik] certificate> print
Flags: K - decrypted-private-key, Q - private-key, R - rsa, D - dsa
0 KR name="cert1" subject=C=LV,ST=.,O=.,CN=cert.test.mt.lv
issuer=C=LV,ST=.,O=.,CN=third serial-number="01"
invalid-before=sep/17/2003 11:56:19 invalid-after=sep/16/2004 11:56:19
ca=yes
[admin@MikroTik] certificate>
Now the certificate may be used by HotSpot servlet:
[admin@MikroTik] ip service> print
Flags: X - disabled, I - invalid
# NAME PORT ADDRESS CERTIFICATE
0 telnet 23 0.0.0.0/0
1 ftp 21 0.0.0.0/0
2 www 8081 0.0.0.0/0
3 hotspot 80 0.0.0.0/0
4 ssh 22 0.0.0.0/0
5 hotspot-ssl 443 0.0.0.0/0 none
[admin@MikroTik] ip service> set hotspot-ssl certificate=
cert1 none
[admin@MikroTik] ip service> set hotspot-ssl certificate=cert1
[admin@MikroTik] ip service> print
Flags: X - disabled, I - invalid
# NAME PORT ADDRESS CERTIFICATE
0 telnet 23 0.0.0.0/0
1 ftp 21 0.0.0.0/0
2 www 8081 0.0.0.0/0
3 hotspot 80 0.0.0.0/0
4 ssh 22 0.0.0.0/0
5 hotspot-ssl 443 0.0.0.0/0 cert1
[admin@MikroTik] ip service>
