procedures:internal_ca
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| procedures:internal_ca [2023/02/08 09:51] – gizmo | procedures:internal_ca [2023/02/10 13:45] (Version actuelle) – gizmo | ||
|---|---|---|---|
| Ligne 8: | Ligne 8: | ||
| openssl x509 -in rootCA.crt -noout -serial > rootCA.srl | openssl x509 -in rootCA.crt -noout -serial > rootCA.srl | ||
| ``` | ``` | ||
| + | |||
| + | Certif à importer : https:// | ||
| ## Client Cert | ## Client Cert | ||
| - | Script dispo ici : | + | Script dispo ici **/ |
| ``` | ``` | ||
| - | # | + | # |
| if [ " | if [ " | ||
| echo " | echo " | ||
| Ligne 34: | Ligne 36: | ||
| if [[ " | if [[ " | ||
| + | echo " | ||
| + | echo " | ||
| + | subjectKeyIdentifier | ||
| + | authorityKeyIdentifier = keyid: | ||
| + | keyUsage | ||
| + | issuerAltName | ||
| + | subjectAltName | ||
| + | " > v3.ext_${FQDN} | ||
| + | |||
| echo "Valid fqdn, generate certificate for ${FQDN}" | echo "Valid fqdn, generate certificate for ${FQDN}" | ||
| - | openssl genrsa -out ${FQDN}.key 4096 | + | openssl genrsa -out ${DEST_CERT}/ |
| + | chmod 0644 ${DEST_CERT}/ | ||
| openssl req -new -key " | openssl req -new -key " | ||
| -sha512 \ | -sha512 \ | ||
| -subj "/ | -subj "/ | ||
| -out " | -out " | ||
| - | openssl x509 -days 365 -req -sha512 -in " | + | openssl x509 -days 365 -req -sha512 -in " |
| + | |||
| + | cat ${DEST_CERT}/ | ||
| + | |||
| + | rm v3.ext_${FQDN} | ||
| else | else | ||
| echo "Not a valid fqdn!" | echo "Not a valid fqdn!" | ||
| exit 1 | exit 1 | ||
| fi | fi | ||
| + | ``` | ||
| + | |||
| + | ## Vhost delivery | ||
| + | |||
| + | Sur rda.grif, y a un vhost qui permet d' | ||
| + | ``` | ||
| + | server { | ||
| + | listen *:80; | ||
| + | |||
| + | server_name | ||
| + | |||
| + | access_log / | ||
| + | error_log / | ||
| + | |||
| + | location / { | ||
| + | try_files $uri @redirect; | ||
| + | } | ||
| + | |||
| + | location @redirect { | ||
| + | return 301 https:// | ||
| + | } | ||
| + | } | ||
| + | |||
| + | server { | ||
| + | listen 443 ssl http2; | ||
| + | listen [::]:443 ssl http2; | ||
| + | server_name | ||
| + | |||
| + | if ($host = ' | ||
| + | rewrite | ||
| + | } | ||
| + | |||
| + | index index.html index.htm index.php; | ||
| + | access_log | ||
| + | error_log | ||
| + | |||
| + | include / | ||
| + | |||
| + | ssl_certificate / | ||
| + | ssl_certificate_key / | ||
| + | |||
| + | location / { | ||
| + | root / | ||
| + | autoindex on; | ||
| + | |||
| + | location ~\.key { | ||
| + | allow 172.17.0.63; | ||
| + | deny all; | ||
| + | } | ||
| + | |||
| + | location ~\.(sh|srl|csr)$ { | ||
| + | deny all; | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| ``` | ``` | ||
procedures/internal_ca.1675849908.txt.gz · Dernière modification : de gizmo
