> Source: https://docs.cyberelements.io/bastion/4.7/cs/Usage/Configuration/SystemConsole/ApplyWebCertificate/

# Configuring a Web Certificate

Access the Mediation Controller server's web interface with the URI `/system`.

> **Examples**
>
> If access to the Mediation Controller on its web IP address is `10.0.10.10`, then access to the system interface will use the URL: https://10.0.10.10/system.
>
> If access to the Mediation Controller is possible with a DNS name, for example `cyberelements-bastion.domain.local`, then access to the system interface will use the URL: https://cyberelements-bastion.domain.local/system.
>
> > **Important !**
> >
> > For any changes to the password, licence, or certificates (SSL Router, Watchdog, and CyberElements Bastion client), connect to the actual IP address for clusters (`RIP_MC_WEB_MASTER` or `RIP_MC_WEB_SLAVE`).

## Creating a PKI

1. Select the tile `PKIs`: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_Tile_PKIs.png)
2. Click on the PKI creation button: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_PKIs_Add.png)
3. Give the new PKI a name: without spaces or accented characters, using only letters, digits, `.`, `_` and `-` (any other name is rejected without an error message). Add a description if necessary. Select `Certificates for Web servers` in the `Usage` field and then click `Validate`: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_PKIs_AddForm.png)
4. Edit the new PKI by clicking on the gear icon, then open the `Certificate authorities` tab: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_PKIs_Edit.png)
5. Then add new certification authorities using the following button: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_PKIs_CertificateAuthorities_Add.png)
6. Select your certification authority certificate file, in PEM format (`PEM certificate for this CA` field), and confirm your choice: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_PKIs_CertificateAuthorities_AddForm.png)

   You will need to repeat the last two steps as many times as you have certification authorities. We recommend adding all certification authorities.

   > **Warning**
   >
   > Your web certificate, the one whose CN matches your domain name, should not be added as a certificate authority certificate. This error may cause alerts on some web browsers.
7. Select the lowest level of certification authorities, the one that signed the web certificate (the `Depth` column shows `Root` for the root certification authority), then click on `Configure certificates`: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_PKIs_CertificateAuthorities_ConfigureCertificates.png)
8. Add the new certificate using the add button then enter the certificate information: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_PKIs_Certificates_AddForm.png)

## Applying the certificate

We do not recommend modifying the `default` web interface; therefore, there are two possible scenarios:

1. Create a new web interface to apply the web certificate
2. Modify the web certificate of an existing web interface

Click on the tile `Virtual Hosts`:

![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_Tile_VirtualHosts.png)

**Create a new web interface**

> 1. Click on the + button:
>
>    ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_VirtualHosts_WebInterfaces_Add.png)
> 2. An `Add new Web interface` window will open.
>
> **Standalone Architecture**
>
> > ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_VirtualHosts_WebInterfaces_AddForm.png)
> >
> > Perform the following actions:
> >
> > - Select the IP address of your Mediation Controller server in the `Host` list (or `Custom IP address` to enter another address), and keep port `443` (1)
> > - Enter the name of the PKI created previously (2)
> > - Enter the certification authority containing the web certificate (3)
> > - Select the certificate (4)
> > - Add the virtual host used (5), choose at least one VPN web virtual host in order to have access to the web consoles. Several virtual hosts can be added.
> > - Click on the + button to add the selected virtual host (6)
> > - Click on the `Validate` (7) button.
> >
> > !!! info "Information" Once the new web interface is validated, the system console session expires: log in again.
>
> **Cluster Architecture**
>
> > ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_VirtualHosts_WebInterfaces_AddFormCluster.png)
> >
> > Perform the following actions:
> >
> > - Select the virtual IP address of the web connections (`VIP_MC_WEB`) in the `Host` list, and keep port `443` (1)
> > - Keep `On the master` and `On the slave` checked (2): the web interface is deployed on both Mediation Controller servers. The `Host` list also offers the real address of each server (`RIP_MC_WEB_MASTER`, `RIP_MC_WEB_SLAVE`): selecting one restricts the web interface to that server, for example to reach it directly for administration.
> > - Enter the name of the PKI created previously (3)
> > - Enter the certification authority containing the web certificate (4)
> > - Select the certificate (5)
> > - Add the virtual host used (6), choose at least one VPN web virtual host in order to have access to the web consoles. Several virtual hosts can be added.
> > - Click on the + button to add the selected virtual host (7)
> > - Click on the `Validate` (8) button.

**Modify the web certificate of an existing web interface**

> 1. Select the web interface to be modified and click on the edit settings button: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_VirtualHosts_WebInterfaces_Edit.png)
> 2. If necessary, modify the PKI to which the new web certificate belongs, then assign the desired web certificate and confirm the modification: ![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_Install_System_VirtualHosts_WebInterfaces_EditForm.png)
