# Securité



# Authentification Simple et administration des droits

MySQL implémente un système sophistiqué de contrôle d'accès et de privilèges qui vous permet de créer des règles d'accès complètes pour la gestion des opérations client et d'empêcher efficacement les clients non autorisés d'accéder au système de base de données.

Le contrôle d'accès MySQL comporte deux étapes lorsqu'un client se connecte au serveur:

- Vérification de la connexion: un client qui se connecte au serveur de base de données MySQL doit avoir un nom d'utilisateur et un mot de passe valides. De plus, l'hôte à partir duquel le client se connecte doit correspondre à l'hôte dans la table de droits MySQL.
- Vérification de la demande: une fois la connexion établie avec succès, MySQL vérifie, pour chaque instruction émise par le client, si le client dispose des privilèges suffisants pour exécuter cette instruction. MySQL peut vérifier un privilège au niveau de la base de données, de la table et du champ.

##   
Création de comptes d'utilisateurs à l'aide de l'instruction MySQL CREATE USER

MySQL fournit l'instruction CREATE USER qui vous permet de créer un nouveau compte utilisateur. La syntaxe de l'instruction CREATE USER est la suivante:  
CREATE USER ''compte\_utilisateur'' IDENTIFIED BY ''mot de passe'';

Le compte utilisateur au format 'nom\_utilisateur' @ 'nom\_hôte' est suivi de la clause CREATE USER.

Le mot de passe est spécifié dans la clause IDENTIFIED BY. Le mot de passe doit être en texte clair. MySQL chiffrera le mot de passe avant de sauvegarder le compte utilisateur dans la table user.

```
CREATE USER myuser@localhost IDENTIFIED BY 'myuser';
Query OK, 0 rows affected (0,06 sec)
```

Puis la connexion peut s'établir ainsi:

```
./bin/mysql -u myuser -h localhost -p
```

L'utilisateur peut se connecter mais n'a pour l'instant aucun droit

```
show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0,00 sec)
```

Les droits de notre utilisateurs sont ainsi:

```
SHOW GRANTS FOR 'myuser'@'localhost';
+--------------------------------------------+
| Grants for myuser@localhost |
+--------------------------------------------+
| GRANT USAGE ON *.* TO `myuser`@`localhost` |
+--------------------------------------------+
1 row in set (0,00 sec)
```

##   
creation d'un utilisateur avec un plugin d'authentification

  
Il est possible d'utiliser un plugin d'authentification spécifique ici un plugin sha256

```
CREATE USER 'sha256user'@'localhost'
-> IDENTIFIED WITH sha256_password BY 'password';
```

##   
Augmentation de la sécurité via le plugin de validation de password

  
Le plugin validate\_password sert à tester les mots de passe et à améliorer la sécurité. Le plugin expose un ensemble de variables système qui vous permettent de définir une politique de mot de passe.

```
mysql> INSTALL PLUGIN validate_password SONAME 'validate_password.so';
Query OK, 0 rows affected, 1 warning (0,07 sec)

mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS
-> FROM INFORMATION_SCHEMA.PLUGINS
-> WHERE PLUGIN_NAME LIKE 'validate%';
+-------------------+---------------+
| PLUGIN_NAME | PLUGIN_STATUS |
+-------------------+---------------+
| validate_password | ACTIVE |
+-------------------+---------------+
1 row in set (0,00 sec)
```

On teste maintenant la création d'un mot de passe pauvre

```
create user 'bob'@'%' IDENTIFIED BY 'test';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
```

  
Il est possible de charger une strategie de validation:

- La stratégie LOW teste uniquement la longueur du mot de passe. Les mots de passe doivent comporter au moins 8 caractères. Pour changer cette longueur, modifiez validate\_password\_length.
- La stratégie MEDIUM ajoute les conditions selon lesquelles les mots de passe doivent contenir au moins un caractère numérique, un caractère minuscule, un caractère majuscule et un caractère spécial (non alphanumérique). Pour modifier ces valeurs, modifiez validate\_password\_number\_count, validate\_password\_mixed\_case\_count et validate\_password\_special\_char\_count.
- La stratégie STRONG ajoute la condition selon laquelle les sous-chaînes de mot de passe de longueur égale ou supérieure à 4 ne doivent pas correspondre aux mots du fichier de dictionnaire, s'il en a été spécifié. Pour spécifier le fichier de dictionnaire, modifiez validate\_password\_dictionary\_file.

Ici on selectionne la stratégie medium par défaut

```
SET GLOBAL validate_password_policy = 1;
Query OK, 0 rows affected (0,00 sec)

mysql> create user 'bob'@'%' identified by 'aA!12345678';
Query OK, 0 rows affected (0,05 sec)
```

## Assignation d'un droit a un utilisateur

La commande GRANT permet d'associer un droit à un utilisateur. Nous donnons ici le droit show databases à l'utilisateur myuser

```
mysql> grant show databases on *.* TO 'myuser'@'localhost';
Query OK, 0 rows affected (0,13 sec)

mysql> \q
Bye
```

  
Nous pouvons maintenant le tester

```
pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64$ ./bin/mysql -u myuser -h localhost -p
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| testUtf8 |
| testdb |
+--------------------+
6 rows in set (0,00 sec)
```

## Mise en place de Rôle

  
En règle générale, vous avez plusieurs utilisateurs avec le même ensemble de privilèges. Le moyen d'octroyer et de révoquer des privilèges à plusieurs utilisateurs de modifier les privilèges de chaque utilisateur individuellement demande beaucoup de temps.

Pour faciliter les choses, MySQL a fourni un nouvel objet appelé role, qui est une collection nommée de privilèges.

Si vous souhaitez accorder le même ensemble de privilèges à plusieurs utilisateurs, procédez comme suit:

- Tout d'abord, créez un nouveau rôle.
- Deuxièmement, accordez des privilèges au rôle.
- Troisièmement, accordez le rôle aux utilisateurs.

Si vous souhaitez modifier les privilèges des utilisateurs, vous devez modifier uniquement les privilèges du rôle attribué. Les modifications prendront effet pour tous les utilisateurs auxquels le rôle a été attribué.

Nous allons créer une base de données exemple:

```
CREATE DATABASE crm;
Query OK, 1 row affected (0,05 sec)

mysql> use crm;
Database changed
mysql> CREATE TABLE customer(
-> id INT PRIMARY KEY AUTO_INCREMENT,
-> first_name varchar(255) NOT NULL,
-> last_name VARCHAR(255) NOT NULL,
-> phone VARCHAR(15) NOT NULL,
-> email VARCHAR(255)
-> );
Query OK, 0 rows affected (0,11 sec)

mysql> INSERT INTO customer(first_name,last_name,phone,email)
-> VALUES('John','Doe','(408)-987-7654','john.doe@mysql.org'),
-> ('Lily','Bush','(408)-987-7985','lily.bush@mysql.org');
Query OK, 2 rows affected (0,06 sec)
Records: 2 Duplicates: 0 Warnings: 0
```

Puis nous créons 3 rôle permettant respectivement d^'etre un super utilisateur de la base, de pouvoir la lire et de pouvoir l'écrire

```
mysql> CREATE ROLE crm_dev, crm_read, crm_write;
Query OK, 0 rows affected (0,05 sec)

mysql> GRANT ALL ON crm.* TO crm_dev;
Query OK, 0 rows affected (0,07 sec)

mysql> GRANT SELECT ON crm.* TO crm_read;
Query OK, 0 rows affected (0,11 sec)

mysql> GRANT INSERT, UPDATE, DELETE ON crm.* TO crm_write;
Query OK, 0 rows affected (0,05 sec)
```

  
Puis nous créons des utilisateurs

```
mysql> -- developer user
mysql> CREATE USER crm_dev1@localhost IDENTIFIED BY 'Secure$1782';
Query OK, 0 rows affected (0,03 sec)

mysql> -- read access user
mysql> CREATE USER crm_read1@localhost IDENTIFIED BY 'Secure$5432';
Query OK, 0 rows affected (0,01 sec)

mysql> -- read/write users
mysql> CREATE USER crm_write1@localhost IDENTIFIED BY 'Secure$9075';
Query OK, 0 rows affected (0,01 sec)

mysql> CREATE USER crm_write2@localhost IDENTIFIED BY 'Secure$3452';
Query OK, 0 rows affected (0,14 sec)
```

Enfin nous associons nos utilisateurs a nos rôle

```
mysql> GRANT crm_dev TO crm_dev1@localhost;
Query OK, 0 rows affected (0,08 sec)

mysql>
mysql> GRANT crm_read TO crm_read1@localhost;
Query OK, 0 rows affected (0,01 sec)

mysql>
mysql> GRANT crm_read, crm_write TO crm_write1@localhost, crm_write2@localhost;
Query OK, 0 rows affected (0,11 sec)
```

Il est possible de voir les droits d'un utilisateur, qui sont en fait les droits de l'utilisateur associé aux roles:

```
SHOW GRANTS FOR crm_dev1@localhost;
+-----------------------------------------------+
| Grants for crm_dev1@localhost |
+-----------------------------------------------+
| GRANT USAGE ON *.* TO `crm_dev1`@`localhost` |
| GRANT `crm_dev`@`%` TO `crm_dev1`@`localhost` |
+-----------------------------------------------+
2 rows in set (0,00 sec)
```

Pour voir les droits d'un utilisateur en fonction d'un rôle, il faut le demander explicitement via la clause USING

```
mysql> SHOW GRANTS FOR crm_write1@localhost USING crm_write;
+---------------------------------------------------------------------+
| Grants for crm_write1@localhost |
+---------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `crm_write1`@`localhost` |
| GRANT INSERT, UPDATE, DELETE ON `crm`.* TO `crm_write1`@`localhost` |
| GRANT `crm_read`@`%`,`crm_write`@`%` TO `crm_write1`@`localhost` |
+---------------------------------------------------------------------+
3 rows in set (0,00 sec)
```

Les droits sont associé a un rôle. Lors de la connection à MySQL, l'utilisateur doit spécifier le rôle qu'il souhaite utiliser

```
pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64$ ./bin/mysql -u crm_read1 -h localhost -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 20
Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select current_role();
+----------------+
| current_role() |
+----------------+
| NONE |
+----------------+
1 row in set (0,00 sec)

mysql> SET ROLE crm_read;
Query OK, 0 rows affected (0,00 sec)

mysql> select current_role() ;
+----------------+
| current_role() |
+----------------+
| `crm_read`@`%` |
+----------------+
1 row in set (0,00 sec)

mysql> use crm;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
```

## connexion via PAM

  
Les plugins d'authentification sont multiples en version entreprise et sont souvent en version GPL avec mariadb.  
Il est possible d'authentifier les utilisateurs via PAM en utilisant le systeme unix pour les authentifier en lieu et place de MySQL.  
Sous mariadb installer le plugin auth\_pam

```
INSTALL SONAME 'auth_pam';
```

  
Puis créer un utilisateur qui pourras se connecter via pam

```
CREATE USER 'test_pam'@'localhost' IDENTIFIED VIA pam USING 'mariadb';

```

Créer l'utilisateur sous Linux (ici ubuntu)

```
addUser test_pam
```

  
Dans le repertoire /etc/pam.d on va editer la configuration pam de MySQL en demandant a ce que la vérification des utilisateurs se fasse via les comptes Unix

```
#%PAM-1.0
@include common-auth
@include common-account
@include common-session-noninteractive
```

# Connection et SSL

##  maximum de connection et maximum de connection utilisateur

- max\_user\_connections : Le nombre maximum de connexions simultanées autorisées sur un compte utilisateur MySQL donné. Une valeur de 0 (valeur par défaut) signifie «aucune limite».Cette variable a une valeur globale qui peut être définie au démarrage ou à l'exécution du serveur. Il a également une valeur de session en lecture seule qui indique la limite effective de connexion simultanée qui s'applique au compte associé à la session en cours.

- max\_connections Le nombre maximum autorisé de connexions client simultanées

Par défaut dans l'installation :

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-mysql%3E-select-%40%40max_"><textarea style="display: none;">mysql&gt; select @@max\_user\_connections ; +------------------------+ | @@max\_user\_connections | +------------------------+ | 0 | +------------------------+ 1 row in set (0,00 sec) mysql&gt; select @@max\_connections ; +-------------------+ | @@max\_connections | +-------------------+ | 151 | +-------------------+ 1 row in set (0,00 sec)</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" style="bottom: 0px;" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 293px; min-width: 281.766px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>15</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">mysql> select @@max_user_connections ;</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">+------------------------+</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| @@max_user_connections |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div>```
<span role="presentation" style="padding-right: 0.1px;">+------------------------+</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| 0 |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div>```
<span role="presentation" style="padding-right: 0.1px;">+------------------------+</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div>```
<span role="presentation" style="padding-right: 0.1px;">1 row in set (0,00 sec)</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div>```
<span role="presentation" style="padding-right: 0.1px;">mysql> select @@max_connections ;</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">10</div></div>```
<span role="presentation" style="padding-right: 0.1px;">+-------------------+</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">11</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| @@max_connections |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">12</div></div>```
<span role="presentation" style="padding-right: 0.1px;">+-------------------+</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">13</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| 151 |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">14</div></div>```
<span role="presentation" style="padding-right: 0.1px;">+-------------------+</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">15</div></div>```
<span role="presentation" style="padding-right: 0.1px;">1 row in set (0,00 sec)</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 293px;"></div><div class="CodeMirror-gutters" style="height: 306px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>  
Un bon conseil est de fixer max\_user\_connections à 50 à 75% de vos paramètres max\_connections. Vous définissez cette valeur dans la section mysqld de votre my.cnf:

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-max_connections-%3D-40"><textarea style="display: none;">max\_connections = 400 max\_user\_connections=200</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 46px; min-width: 180.531px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>2</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">max_connections = 400</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">max_user_connections=200</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 46px;"></div><div class="CodeMirror-gutters" style="height: 59px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>##   
maximum de connection pour un utilisateur

Le settings précédent concerne une mise en place assez globale du nombre de connection.   
Il est possible de signifier des limits plus fine en terme de temps et de ressources  
Il existe différents types de limites pouvant être utilisés:

- MAX\_QUERIES\_PER\_HOUR Limite le compte à X requêtes par heure.
- MAX\_UPDATES\_PER\_HOUR Limite le compte à X relevés UPDATE par heure.
- MAX\_CONNECTIONS\_PER\_HOUR Limite le compte à un total de X connexions par heure.
- MAX\_USER\_CONNECTIONS Limite le compte à un total de X connexions simultanées pour le compte.

Par exemple, on limite le nombre de connection de myuser à 5

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-mysql%3E-alter-user-%27m"><textarea style="display: none;">mysql&gt; ALTER USER 'myuser'@'localhost' WITH MAX\_USER\_CONNECTIONS 5; </textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 46px; min-width: 491.453px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>2</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">mysql> ALTER USER 'myuser'@'localhost' WITH MAX_USER_CONNECTIONS 5;</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 46px;"></div><div class="CodeMirror-gutters" style="height: 59px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>## LOCK et Unlock Account

Account lock et Account unlock permette de vérrouiller ou pas un utilisateur

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-alter-user-%27myuser%27%40"><textarea style="display: none;">ALTER USER 'myuser'@'localhost' ACCOUNT LOCK; Query OK, 0 rows affected (0,09 sec) mysql&gt; \\q Bye pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64$ ./bin/mysql -u myuser -h localhost -p Enter password: ERROR 3118 (HY000): Access denied for user 'myuser'@'localhost'. Account is locked. </textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 179px; min-width: 715.594px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>9</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">ALTER USER 'myuser'@'localhost' ACCOUNT LOCK;</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Query OK, 0 rows affected (0,09 sec)</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div>```
<span role="presentation" style="padding-right: 0.1px;">mysql> \q</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Bye</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div>```
<span role="presentation" style="padding-right: 0.1px;">pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64$ ./bin/mysql -u myuser -h localhost -p</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Enter password:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div>```
<span role="presentation" style="padding-right: 0.1px;">ERROR 3118 (HY000): Access denied for user 'myuser'@'localhost'. Account is locked.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 179px;"></div><div class="CodeMirror-gutters" style="height: 192px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>## Mise en place de SSL

  
Pour l'instant la connection entre le client et le serveur est faite en claire.

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-status--------------"><textarea style="display: none;">status -------------- ./bin/mysql Ver 8.0.13 for linux-glibc2.12 on x86\_64 (MySQL Community Server - GPL) Connection id: 10 Current database: Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 8.0.13 MySQL Community Server - GPL Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 UNIX socket: /tmp/mysql.sock Uptime: 29 min 39 sec Threads: 2 Questions: 22 Slow queries: 0 Opens: 136 Flush tables: 2 Open tables: 106 Queries per second avg: 0.012 --------------</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" style="bottom: 17px;" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" style="display: block; right: 0px; left: 30px;" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 831.281px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true" style="height: 17px; width: 17px;"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 445px; min-width: 831.281px; padding-right: 0px; padding-bottom: 17px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>23</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">status</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">--------------</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">./bin/mysql Ver 8.0.13 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Connection id: 10</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Current database:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Current user: root@localhost</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div>```
<span role="presentation" style="padding-right: 0.1px;">SSL: Not in use</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Current pager: stdout</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">10</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Using outfile: ''</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">11</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Using delimiter: ;</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">12</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Server version: 8.0.13 MySQL Community Server - GPL</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">13</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Protocol version: 10</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">14</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Connection: Localhost via UNIX socket</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">15</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Server characterset: utf8mb4</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">16</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Db characterset: utf8mb4</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">17</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Client characterset: utf8mb4</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">18</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Conn. characterset: utf8mb4</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">19</div></div>```
<span role="presentation" style="padding-right: 0.1px;">UNIX socket: /tmp/mysql.sock</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">20</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Uptime: 29 min 39 sec</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">21</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">22</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Threads: 2 Questions: 22 Slow queries: 0 Opens: 136 Flush tables: 2 Open tables: 106 Queries per second avg: 0.012</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">23</div></div>```
<span role="presentation" style="padding-right: 0.1px;">--------------</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 17px solid transparent; top: 445px;"></div><div class="CodeMirror-gutters" style="height: 475px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>### Création de l'autorité de certification

  
Exécutez les commandes suivantes pour créer les clés de l'autorité de certification (CA):

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-pilou%40lubuntu%3A%7E%2Fmysq"><textarea style="display: none;">pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64$ mkdir ssl\_keys pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64$ openssl genrsa 2048 &gt; ./ssl\_keys/ca-key.pem Generating RSA private key, 2048 bit long modulus (2 primes) .........................................................................+++++ ...............................+++++ e is 65537 (0x010001) pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64$ openssl req -sha1 -new -x509 -nodes -days 3650 -key ./ssl\_keys/ca-key.pem &gt; ./ssl\_keys/ca-cert.pem</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" style="display: block; right: 0px; left: 30px;" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 1156.66px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 141px; min-width: 1156.66px; padding-right: 0px; padding-bottom: 17px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>7</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64$ mkdir ssl_keys</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64$ openssl genrsa 2048 > ./ssl_keys/ca-key.pem</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Generating RSA private key, 2048 bit long modulus (2 primes)</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div>```
<span role="presentation" style="padding-right: 0.1px;">.........................................................................+++++</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div>```
<span role="presentation" style="padding-right: 0.1px;">...............................+++++</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div>```
<span role="presentation" style="padding-right: 0.1px;">e is 65537 (0x010001)</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div>```
<span role="presentation" style="padding-right: 0.1px;">pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64$ openssl req -sha1 -new -x509 -nodes -days 3650 -key ./ssl_keys/ca-key.pem > ./ssl_keys/ca-cert.pem</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 17px solid transparent; top: 141px;"></div><div class="CodeMirror-gutters" style="height: 171px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>### Création de la clef serveur et du certificat serveur

Exécutez les commandes suivantes pour créer la clé SSL et le certificat du serveur:

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-openssl-req--sha1--n"><textarea style="display: none;">openssl req -sha1 -newkey rsa:2048 -days 3650 -nodes -keyout ./ssl\_keys/server-key.pem &gt; ./ssl\_keys/server-req.pem openssl x509 -sha1 -req -in ./ssl\_keys/server-req.pem -days 3650 -CA ./ssl\_keys/ca-cert.pem -CAkey ./ssl\_keys/ca-key.pem -set\_serial 01 &gt; ./ssl\_keys/server-cert.pem openssl rsa -in ./ssl\_keys/server-key.pem -out ./ssl\_keys/server-key.pem</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" style="display: block; right: 0px; left: 30px;" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 1192.8px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 65px; min-width: 1192.8px; padding-right: 0px; padding-bottom: 17px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>3</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">openssl req -sha1 -newkey rsa:2048 -days 3650 -nodes -keyout ./ssl_keys/server-key.pem > ./ssl_keys/server-req.pem</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">openssl x509 -sha1 -req -in ./ssl_keys/server-req.pem -days 3650 -CA ./ssl_keys/ca-cert.pem -CAkey ./ssl_keys/ca-key.pem -set_serial 01 > ./ssl_keys/server-cert.pem</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">openssl rsa -in ./ssl_keys/server-key.pem -out ./ssl_keys/server-key.pem</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 17px solid transparent; top: 65px;"></div><div class="CodeMirror-gutters" style="height: 95px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>###   
Création de la clef serveur et du certificat client

Exécutez les commandes suivantes pour créer la clé SSL et le certificat du client:

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-openssl-req--sha1--n-0"><textarea style="display: none;">openssl req -sha1 -newkey rsa:2048 -days 3650 -nodes -keyout ./ssl\_keys/client-key.pem &gt; ./ssl\_keys/client-req.pem openssl x509 -sha1 -req -in ./ssl\_keys/client-req.pem -days 3650 -CA ./ssl\_keys/ca-cert.pem -CAkey ./ssl\_keys/ca-key.pem -set\_serial 01 &gt; ./ssl\_keys/client-cert.pem openssl rsa -in ./ssl\_keys/client-key.pem -out ./ssl\_keys/client-key.pem</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" style="display: block; right: 0px; left: 30px;" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 1192.8px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 65px; min-width: 1192.8px; padding-right: 0px; padding-bottom: 17px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>3</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">openssl req -sha1 -newkey rsa:2048 -days 3650 -nodes -keyout ./ssl_keys/client-key.pem > ./ssl_keys/client-req.pem</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">openssl x509 -sha1 -req -in ./ssl_keys/client-req.pem -days 3650 -CA ./ssl_keys/ca-cert.pem -CAkey ./ssl_keys/ca-key.pem -set_serial 01 > ./ssl_keys/client-cert.pem</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">openssl rsa -in ./ssl_keys/client-key.pem -out ./ssl_keys/client-key.pem</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 17px solid transparent; top: 65px;"></div><div class="CodeMirror-gutters" style="height: 95px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>### Sortie de OpenSSL

Pour avoir de bon certifiact, il est important de selectionner des CN différents pour les CA, server et client

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-pilou%40lubuntu%3A%7E%2Fmysq-0"><textarea style="display: none;">pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64$ ./ssl.sh Generating RSA private key, 2048 bit long modulus (2 primes) ...............................................+++++ ..............................+++++ e is 65537 (0x010001) You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) \[AU\]: State or Province Name (full name) \[Some-State\]: Locality Name (eg, city) \[\]: Organization Name (eg, company) \[Internet Widgits Pty Ltd\]: Organizational Unit Name (eg, section) \[\]: Common Name (e.g. server FQDN or YOUR name) \[\]:CA Email Address \[\]: Ignoring -days; not generating a certificate Generating a RSA private key ............+++++ ......................................+++++ writing new private key to '/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/server-key.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) \[AU\]: State or Province Name (full name) \[Some-State\]: Locality Name (eg, city) \[\]: Organization Name (eg, company) \[Internet Widgits Pty Ltd\]: Organizational Unit Name (eg, section) \[\]: Common Name (e.g. server FQDN or YOUR name) \[\]:server Email Address \[\]: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password \[\]: An optional company name \[\]: Signature ok subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = server Getting CA Private Key writing RSA key Ignoring -days; not generating a certificate Generating a RSA private key .................................+++++ .....................+++++ writing new private key to '/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/client-key.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) \[AU\]: State or Province Name (full name) \[Some-State\]: Locality Name (eg, city) \[\]: Organization Name (eg, company) \[Internet Widgits Pty Ltd\]: Organizational Unit Name (eg, section) \[\]: Common Name (e.g. server FQDN or YOUR name) \[\]:client Email Address \[\]: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password \[\]: An optional company name \[\]: Signature ok subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = client Getting CA Private Key writing RSA key</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" style="bottom: 17px;" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" style="display: block; right: 0px; left: 30px;" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 787.891px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true" style="height: 17px; width: 17px;"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 1471px; min-width: 787.891px; padding-right: 0px; padding-bottom: 17px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>77</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64$ ./ssl.sh</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Generating RSA private key, 2048 bit long modulus (2 primes)</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">...............................................+++++</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div>```
<span role="presentation" style="padding-right: 0.1px;">..............................+++++</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div>```
<span role="presentation" style="padding-right: 0.1px;">e is 65537 (0x010001)</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div>```
<span role="presentation" style="padding-right: 0.1px;">You are about to be asked to enter information that will be incorporated</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div>```
<span role="presentation" style="padding-right: 0.1px;">into your certificate request.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div>```
<span role="presentation" style="padding-right: 0.1px;">What you are about to enter is what is called a Distinguished Name or a DN.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div>```
<span role="presentation" style="padding-right: 0.1px;">There are quite a few fields but you can leave some blank</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">10</div></div>```
<span role="presentation" style="padding-right: 0.1px;">For some fields there will be a default value,</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">11</div></div>```
<span role="presentation" style="padding-right: 0.1px;">If you enter '.', the field will be left blank.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">12</div></div>```
<span role="presentation" style="padding-right: 0.1px;">-----</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">13</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Country Name (2 letter code) [AU]:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">14</div></div>```
<span role="presentation" style="padding-right: 0.1px;">State or Province Name (full name) [Some-State]:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">15</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Locality Name (eg, city) []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">16</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Organization Name (eg, company) [Internet Widgits Pty Ltd]:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">17</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Organizational Unit Name (eg, section) []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">18</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Common Name (e.g. server FQDN or YOUR name) []:CA</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">19</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Email Address []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">20</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Ignoring -days; not generating a certificate</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">21</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Generating a RSA private key</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">22</div></div>```
<span role="presentation" style="padding-right: 0.1px;">............+++++</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">23</div></div>```
<span role="presentation" style="padding-right: 0.1px;">......................................+++++</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">24</div></div>```
<span role="presentation" style="padding-right: 0.1px;">writing new private key to '/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/server-key.pem'</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">25</div></div>```
<span role="presentation" style="padding-right: 0.1px;">-----</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">26</div></div>```
<span role="presentation" style="padding-right: 0.1px;">You are about to be asked to enter information that will be incorporated</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">27</div></div>```
<span role="presentation" style="padding-right: 0.1px;">into your certificate request.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">28</div></div>```
<span role="presentation" style="padding-right: 0.1px;">What you are about to enter is what is called a Distinguished Name or a DN.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">29</div></div>```
<span role="presentation" style="padding-right: 0.1px;">There are quite a few fields but you can leave some blank</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">30</div></div>```
<span role="presentation" style="padding-right: 0.1px;">For some fields there will be a default value,</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">31</div></div>```
<span role="presentation" style="padding-right: 0.1px;">If you enter '.', the field will be left blank.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">32</div></div>```
<span role="presentation" style="padding-right: 0.1px;">-----</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">33</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Country Name (2 letter code) [AU]:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">34</div></div>```
<span role="presentation" style="padding-right: 0.1px;">State or Province Name (full name) [Some-State]:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">35</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Locality Name (eg, city) []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">36</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Organization Name (eg, company) [Internet Widgits Pty Ltd]:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">37</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Organizational Unit Name (eg, section) []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">38</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Common Name (e.g. server FQDN or YOUR name) []:server</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">39</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Email Address []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">40</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">41</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Please enter the following 'extra' attributes</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">42</div></div>```
<span role="presentation" style="padding-right: 0.1px;">to be sent with your certificate request</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">43</div></div>```
<span role="presentation" style="padding-right: 0.1px;">A challenge password []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">44</div></div>```
<span role="presentation" style="padding-right: 0.1px;">An optional company name []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">45</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Signature ok</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">46</div></div>```
<span role="presentation" style="padding-right: 0.1px;">subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = server</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">47</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Getting CA Private Key</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">48</div></div>```
<span role="presentation" style="padding-right: 0.1px;">writing RSA key</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">49</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Ignoring -days; not generating a certificate</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">50</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Generating a RSA private key</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">51</div></div>```
<span role="presentation" style="padding-right: 0.1px;">.................................+++++</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">52</div></div>```
<span role="presentation" style="padding-right: 0.1px;">.....................+++++</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">53</div></div>```
<span role="presentation" style="padding-right: 0.1px;">writing new private key to '/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/client-key.pem'</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">54</div></div>```
<span role="presentation" style="padding-right: 0.1px;">-----</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">55</div></div>```
<span role="presentation" style="padding-right: 0.1px;">You are about to be asked to enter information that will be incorporated</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">56</div></div>```
<span role="presentation" style="padding-right: 0.1px;">into your certificate request.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">57</div></div>```
<span role="presentation" style="padding-right: 0.1px;">What you are about to enter is what is called a Distinguished Name or a DN.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">58</div></div>```
<span role="presentation" style="padding-right: 0.1px;">There are quite a few fields but you can leave some blank</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">59</div></div>```
<span role="presentation" style="padding-right: 0.1px;">For some fields there will be a default value,</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">60</div></div>```
<span role="presentation" style="padding-right: 0.1px;">If you enter '.', the field will be left blank.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">61</div></div>```
<span role="presentation" style="padding-right: 0.1px;">-----</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">62</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Country Name (2 letter code) [AU]:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">63</div></div>```
<span role="presentation" style="padding-right: 0.1px;">State or Province Name (full name) [Some-State]:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">64</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Locality Name (eg, city) []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">65</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Organization Name (eg, company) [Internet Widgits Pty Ltd]:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">66</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Organizational Unit Name (eg, section) []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">67</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Common Name (e.g. server FQDN or YOUR name) []:client</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">68</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Email Address []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">69</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">70</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Please enter the following 'extra' attributes</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">71</div></div>```
<span role="presentation" style="padding-right: 0.1px;">to be sent with your certificate request</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">72</div></div>```
<span role="presentation" style="padding-right: 0.1px;">A challenge password []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">73</div></div>```
<span role="presentation" style="padding-right: 0.1px;">An optional company name []:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">74</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Signature ok</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">75</div></div>```
<span role="presentation" style="padding-right: 0.1px;">subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = client</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">76</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Getting CA Private Key</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">77</div></div>```
<span role="presentation" style="padding-right: 0.1px;">writing RSA key</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 17px solid transparent; top: 1471px;"></div><div class="CodeMirror-gutters" style="height: 1501px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>### Modification de MySQL

  
Il faut indiquer à MySQL ou se trouve les différentes clefs et certificat:

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-%5Bmysqld%5D-port-%3D-3306"><textarea style="display: none;">\[mysqld\] port = 3306 socket = /tmp/mysql.sock skip-external-locking key\_buffer\_size = 16K max\_allowed\_packet = 1M table\_open\_cache = 4 sort\_buffer\_size = 64K read\_buffer\_size = 256K read\_rnd\_buffer\_size = 256K net\_buffer\_length = 2K thread\_stack = 128K table\_open\_cache=500 secure\_file\_priv=/tmp max\_connections = 400 max\_user\_connections=200 ssl-ca=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/ca-cert.pem ssl-cert=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/server-cert.pem ssl-key=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/server-key.pem ssl-cipher=DHE-RSA-AES256-SHA \[client\] ssl-cert=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/client-cert.pem ssl-key=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/client-key.pem</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" style="bottom: 0px;" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 464px; min-width: 650.516px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>24</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">[mysqld]</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">port = 3306</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">socket = /tmp/mysql.sock</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div>```
<span role="presentation" style="padding-right: 0.1px;">skip-external-locking</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div>```
<span role="presentation" style="padding-right: 0.1px;">key_buffer_size = 16K</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div>```
<span role="presentation" style="padding-right: 0.1px;">max_allowed_packet = 1M</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div>```
<span role="presentation" style="padding-right: 0.1px;">table_open_cache = 4</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div>```
<span role="presentation" style="padding-right: 0.1px;">sort_buffer_size = 64K</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div>```
<span role="presentation" style="padding-right: 0.1px;">read_buffer_size = 256K</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">10</div></div>```
<span role="presentation" style="padding-right: 0.1px;">read_rnd_buffer_size = 256K</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">11</div></div>```
<span role="presentation" style="padding-right: 0.1px;">net_buffer_length = 2K</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">12</div></div>```
<span role="presentation" style="padding-right: 0.1px;">thread_stack = 128K</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">13</div></div>```
<span role="presentation" style="padding-right: 0.1px;">table_open_cache=500</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">14</div></div>```
<span role="presentation" style="padding-right: 0.1px;">secure_file_priv=/tmp</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">15</div></div>```
<span role="presentation" style="padding-right: 0.1px;">max_connections = 400</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">16</div></div>```
<span role="presentation" style="padding-right: 0.1px;">max_user_connections=200</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">17</div></div>```
<span role="presentation" style="padding-right: 0.1px;">ssl-ca=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/ca-cert.pem</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">18</div></div>```
<span role="presentation" style="padding-right: 0.1px;">ssl-cert=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/server-cert.pem</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">19</div></div>```
<span role="presentation" style="padding-right: 0.1px;">ssl-key=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/server-key.pem</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">20</div></div>```
<span role="presentation" style="padding-right: 0.1px;">ssl-cipher=DHE-RSA-AES256-SHA</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">21</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">22</div></div>```
<span role="presentation" style="padding-right: 0.1px;">[client]</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">23</div></div>```
<span role="presentation" style="padding-right: 0.1px;">ssl-cert=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/client-cert.pem</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">24</div></div>```
<span role="presentation" style="padding-right: 0.1px;">ssl-key=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/client-key.pem</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 464px;"></div><div class="CodeMirror-gutters" style="height: 477px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>Après redemarrage, le serveur signale que le certificat est auto signé

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-2019-01-05t08%3A44%3A05."><textarea style="display: none;">2019-01-05T08:44:05.815408Z 0 \[Warning\] \[MY-010068\] \[Server\] CA certificate /home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/ca-cert.pem is self signed.</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 46px; min-width: 672.203px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>2</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">2019-01-05T08:44:05.815408Z 0 [Warning] [MY-010068] [Server] CA certificate</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/ca-cert.pem is self signed.</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 46px;"></div><div class="CodeMirror-gutters" style="height: 59px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>et les parametre SSL sont bien chargé

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-show-variables-like-"><textarea style="display: none;">SHOW VARIABLES LIKE '%ssl%'; +--------------------+----------------------------------------------------------------------------------+ | Variable\_name | Value | +--------------------+----------------------------------------------------------------------------------+ | have\_openssl | YES | | have\_ssl | YES | | mysqlx\_ssl\_ca | | | mysqlx\_ssl\_capath | | | mysqlx\_ssl\_cert | | | mysqlx\_ssl\_cipher | | | mysqlx\_ssl\_crl | | | mysqlx\_ssl\_crlpath | | | mysqlx\_ssl\_key | | | ssl\_ca | /home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/ca-cert.pem | | ssl\_capath | | | ssl\_cert | /home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/server-cert.pem | | ssl\_cipher | | | ssl\_crl | | | ssl\_crlpath | | | ssl\_fips\_mode | OFF | | ssl\_key | /home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/ssl\_keys/server-key.pem | +--------------------+----------------------------------------------------------------------------------+ 17 rows in set (0,01 sec)</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" style="bottom: 17px;" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" style="right: 0px; left: 30px;" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true" style="height: 17px; width: 17px;"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 445px; min-width: 766.203px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>23</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">SHOW VARIABLES LIKE '%ssl%';</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">+--------------------+----------------------------------------------------------------------------------+</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| Variable_name | Value |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div>```
<span role="presentation" style="padding-right: 0.1px;">+--------------------+----------------------------------------------------------------------------------+</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| have_openssl | YES |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| have_ssl | YES |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| mysqlx_ssl_ca | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| mysqlx_ssl_capath | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| mysqlx_ssl_cert | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">10</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| mysqlx_ssl_cipher | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">11</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| mysqlx_ssl_crl | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">12</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| mysqlx_ssl_crlpath | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">13</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| mysqlx_ssl_key | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">14</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| ssl_ca | /home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/ca-cert.pem |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">15</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| ssl_capath | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">16</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| ssl_cert | /home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/server-cert.pem |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">17</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| ssl_cipher | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">18</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| ssl_crl | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">19</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| ssl_crlpath | |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">20</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| ssl_fips_mode | OFF |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">21</div></div>```
<span role="presentation" style="padding-right: 0.1px;">| ssl_key | /home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/ssl_keys/server-key.pem |</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">22</div></div>```
<span role="presentation" style="padding-right: 0.1px;">+--------------------+----------------------------------------------------------------------------------+</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">23</div></div>```
<span role="presentation" style="padding-right: 0.1px;">17 rows in set (0,01 sec)</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 445px;"></div><div class="CodeMirror-gutters" style="height: 458px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>###   
Test

Nous allons nous connecter en SSL sur le serveur en demandant explicitement a utiliser la connection TCP (ce qui force l'utilisation de SSL)

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-pilou%40lubuntu%3A%7E%2Fmysq-1"><textarea style="display: none;">pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64$ ./bin/mysql --defaults-file=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86\_64/my.cnf -u root -h localhost -p --protocol tcp Enter password: Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 8 Server version: 8.0.13 MySQL Community Server - GPL Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement. mysql&gt; status -------------- ./bin/mysql Ver 8.0.13 for linux-glibc2.12 on x86\_64 (MySQL Community Server - GPL) Connection id: 8 Current database: Current user: root@localhost SSL: Cipher in use is DHE-RSA-AES256-SHA Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 8.0.13 MySQL Community Server - GPL Protocol version: 10 Connection: localhost via TCP/IP Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 TCP port: 3306 Uptime: 20 sec</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" style="bottom: 17px;" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" style="display: block; right: 0px; left: 30px;" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 1380.8px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true" style="height: 17px; width: 17px;"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 654px; min-width: 1380.8px; padding-right: 0px; padding-bottom: 17px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>34</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">pilou@lubuntu:~/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64$ ./bin/mysql --defaults-file=/home/pilou/mysql80/mysql-8.0.13-linux-glibc2.12-x86_64/my.cnf -u root -h localhost -p --protocol tcp</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Enter password:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Welcome to the MySQL monitor. Commands end with ; or \g.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Your MySQL connection id is 8</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">5</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Server version: 8.0.13 MySQL Community Server - GPL</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">6</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">7</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">8</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">9</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Oracle is a registered trademark of Oracle Corporation and/or its</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">10</div></div>```
<span role="presentation" style="padding-right: 0.1px;">affiliates. Other names may be trademarks of their respective</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">11</div></div>```
<span role="presentation" style="padding-right: 0.1px;">owners.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">12</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">13</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">14</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">15</div></div>```
<span role="presentation" style="padding-right: 0.1px;">mysql> status</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">16</div></div>```
<span role="presentation" style="padding-right: 0.1px;">--------------</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">17</div></div>```
<span role="presentation" style="padding-right: 0.1px;">./bin/mysql Ver 8.0.13 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">18</div></div>```
<span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">19</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Connection id: 8</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">20</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Current database:</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">21</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Current user: root@localhost</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">22</div></div>```
<span role="presentation" style="padding-right: 0.1px;">SSL: Cipher in use is DHE-RSA-AES256-SHA</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">23</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Current pager: stdout</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">24</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Using outfile: ''</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">25</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Using delimiter: ;</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">26</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Server version: 8.0.13 MySQL Community Server - GPL</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">27</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Protocol version: 10</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">28</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Connection: localhost via TCP/IP</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">29</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Server characterset: utf8mb4</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">30</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Db characterset: utf8mb4</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">31</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Client characterset: utf8mb4</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">32</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Conn. characterset: utf8mb4</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">33</div></div>```
<span role="presentation" style="padding-right: 0.1px;">TCP port: 3306</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">34</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Uptime: 20 sec</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 17px solid transparent; top: 654px;"></div><div class="CodeMirror-gutters" style="height: 684px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>Installation de SSL pour MariaDB

Créez un répertoire nommé ssl dans le répertoire /etc/mysql/

<div class="CodeMirrorContainer" contenteditable="false" data-lang="" dir="ltr" id="bkmrk-%24-cd-%2Fetc%2Fmysql-%24-su"><textarea style="display: none;">$ cd /etc/mysql $ sudo mkdir ssl $ cd ssl</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 65px; min-width: 122.688px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>3</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">$ cd /etc/mysql</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">$ sudo mkdir ssl</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">$ cd ssl</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 65px;"></div><div class="CodeMirror-gutters" style="height: 78px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div><div class="CodeMirrorContainer" contenteditable="false" data-lang="tw-data-text tw-text-large tw-ta" dir="ltr" id="bkmrk-la-valeur-du-nom-com"><textarea style="display: none;">La valeur du nom commun utilisée pour les certificats/clés du serveur et du client doit être différente de la valeur du nom commun utilisée pour le certificat CA. Pour éviter tout problème, je les règle comme suit. Sinon, vous obtiendrez une erreur d'échec de la vérification de la certification. Par conséquent, définissez-le comme suit : Nom commun de l'AC : administrateur MariaDB Nom commun du serveur : serveur MariaDB Nom commun du client : client MariaDB</textarea><div class="CodeMirror cm-s-base16-light"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" style="display: block; right: 0px; left: 30px;" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 2458.14px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -17px; border-right-width: 13px; min-height: 84px; min-width: 2458.14px; padding-right: 0px; padding-bottom: 17px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>4</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 19px;"> </div></div><div class="CodeMirror-code" role="presentation"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">La valeur du nom commun utilisée pour les certificats/clés du serveur et du client doit être différente de la valeur du nom commun utilisée pour le certificat CA. Pour éviter tout problème, je les règle comme suit. Sinon, vous obtiendrez une erreur d'échec de la vérification de la certification. Par conséquent, définissez-le comme suit :</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Nom commun de l'AC : administrateur MariaDB</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Nom commun du serveur : serveur MariaDB</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">4</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Nom commun du client : client MariaDB</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 17px solid transparent; top: 84px;"></div><div class="CodeMirror-gutters" style="height: 114px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>Tapez la commande suivante pour créer une nouvelle autorité de certification:

# Installation de SSL avec MariaDB sous Debian

Modifiez le fichier /etc/mysql/mariadb.conf.d/50-server.cnf (ou /etc/mysql/mariadb.cnf) comme suit :zLa valeur du nom commun utilisée pour les certificats/clés du serveur et du client doit être différente de la valeur du nom commun utilisée pour le certificat CA. Pour éviter tout problème, je les règle comme suit. Sinon, vous obtiendrez une erreur d'échec de la vérification de la certification. Par conséquent, définissez-le comme suit :  
Nom commun de l'AC : administrateur MariaDB  
Nom commun du serveur : serveur MariaDB  
Nom commun du client : client MariaDB

Créez un répertoire nommé ssl dans le répertoire /etc/mysql/

```
$ cd /etc/mysql
$ sudo mkdir ssl
$ cd ssl
```

Tapez la commande suivante pour créer une nouvelle clé CA :

```
sudo openssl genrsa 4096 > ca-key.pem
```

Tapez la commande suivante pour générer le certificat à l'aide de cette clé :

```
$ sudo openssl req -new -x509 -nodes -days 365000 -key ca-key.pem -out ca-cert.pem
```

Maintenant, vous devez avoir deux fichiers comme suit :

- /etc/mysql/ssl/ca-cert.pem – Fichier de certificat pour l'autorité de certification (CA).
- /etc/mysql/ssl/ca-key.pem – Fichier clé pour l'autorité de certification (CA).

#### Créer le certificat SSL du serveur

Pour créer la clé du serveur, exécutez :

```
sudo openssl req -newkey rsa:2048 -days 365000 -nodes -keyout server-key.pem -out server-req.pem
```

Ensuite, créer la clé RSA du serveur, saisissez :

```
openssl rsa -in server-key.pem -out server-key.pem
```

Enfin, signez le certificat du serveur, exécutez :

```
openssl x509 -req -in server-req.pem -days 365000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
```

Maintenant, vous devez avoir des fichiers supplémentaires :

- /etc/mysql/ssl/server-cert.pem – Fichier de certificat du serveur MariaDB.
- /etc/mysql/ssl/server-key.pem – Fichier de clé du serveur MariaDB.

  
Vous devez utiliser les deux fichiers ci-dessus sur le serveur MariaDB lui-même et sur tout autre nœud que vous allez utiliser pour le trafic de cluster/réplication. Ces deux fichiers sécuriseront la communication côté serveur.

#### Configurer le serveur MariaDB pour utiliser SSL

Modifiez le fichier /etc/mysql/mariadb.conf.d/50-server.cnf comme suit :

```
### MySQL Server ###
## Securing the Database with ssl option and certificates ##
## There is no control over the protocol level used. ##
##  mariadb will use TLSv1.0 or better.  ##
#ssl
ssl-ca=/etc/mysql/ssl/ca-cert.pem
ssl-cert=/etc/mysql/ssl/server-cert.pem
ssl-key=/etc/mysql/ssl/server-key.pem
## Set up TLS version here. For example TLS version 1.2 and 1.3 ##
tls_version = TLSv1.2,TLSv1.3
```

Enregistrez et fermez le fichier. Sécurisez les clés à l'aide de la commande chmod/commande chown :

```
 sudo chown -Rv mysql:root /etc/mysql/ssl/
```