Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.

...

Sv translation
languagede

Diese Anleitung erzeugt ein selbst signiertes Zertifikat für den haproxy Dienst.

OpenSSL Konfiguration


Die Datei /etc/pki/tls/openssl.cnf bearbeiten und diverse Modifikationen machen (Kommentare genau lesen!).

Code Block
title/etc/pki/tls/openssl.cnf
#
# Am Ende einfügen:
#
 
[ alternate_names ]
DNS.1        = acd-lb.domain.de
DNS.2        = acd-lb.domain.local
DNS.3        = acd-lb
 
#
# In diesen Abschnitt einfügen:
#
 
[ v3_ca ]
subjectAltName      = @alternate_names
 
#
# In diesen Abschnitt einfügen bzw. verändern:
#
 
[ v3_ca ]
keyUsage = digitalSignature, keyEncipherment
 
#
# In diesen Abschnitt verändern bzw. einkommentieren:
#
 
[ CA_default ]
copy_extensions = copy


Keys Generieren

Zuerst, ein Verzeichnis für die Keys anlegen, und dann die Keys generieren.

ACHTUNG: Folgender Abschnitt beinhaltet auch Ausgaben vom System.


Code Block
titleKeys Generieren
mkdir /etc/ssl/newkey
openssl genrsa -out /etc/ssl/newkey/cert.key 3072
openssl req -new -x509 -key /etc/ssl/newkey/cert.key -sha256 -out /etc/ssl/newkey/cert.pem -days 730
 
#
# Die Fragen wie folgt (beispielsweise) beantworten:
#

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) [XX]:DE
State or Province Name (full name) []:Bavaria
Locality Name (eg, city) [Default City]:Munich
Organization Name (eg, company) [Default Company Ltd]:jtel GmbH
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your name or your server's hostname) []:acd-lb.domain.de
Email Address []:lewis.graham@jtel.de

Prüfen des generierten Zertifikats

Prüfen ob die Alternative Namen eingetragen wurden:

Code Block
titlePrüfen
openssl x509 -in /etc/ssl/newkey/cert.pem -text -noout


# Prüfen ob bei diesen Eintrag alle DNS Namen stehen:
# X509v3 Subject Alternative Name:

Kombinierte .pem erzeugen und kopieren

Code Block
titleKombinierte PEM
cat /etc/ssl/newkey/cert.key > /etc/ssl/newkey/comb.pem
cat /etc/ssl/newkey/cert.pem >> /etc/ssl/newkey/comb.pem
cp /etc/ssl/newkey/comb.pem /etc/haproxy/haproxy.pem
chmod 400 /etc/haproxy/haproxy.pem

Zertifikat in haproxy.cfg eintragen und Frontendkonfiguration auf umleitung anpassen

Code Block
titleKombinierte PEM
#
# Frontend http leitet auf https um
#
frontend acdportal_http
        mode            http
        bind            :80
        redirect        scheme https if !{ ssl_fc }

#
# Frontend für https mit Zertifikat
#
frontend acdportal_https
        mode            http
        bind            :443 ssl crt /etc/haproxy/haproxy.pem  #verify optional
...


Sv translation
languagefr

Ce guide génère un certificat auto-signé pour le service haproxy.

Configuration d'OpenSSL


Editez le fichier /etc/pki/tls/openssl.cnf et apportez diverses modifications (lisez attentivement les commentaires !)

Translations Ignore


Code Block
title/etc/pki/tls/openssl.cnf
# # Insert at the end: # [ alternate_names ] DNS.1 = acd-lb.domain.de DNS.2 = acd-lb.domain.local DNS.3 = acd-lb # # Insert in this section: # [ v3_ca ] subjectAltName = @alternate_names # # Insert or modify in this section: # [ v3_ca ] keyUsage = digitalSignature, keyEncipherment # # Change or comment in this section: # [ CA_default ] copy_extensions = copy




Générer des clés

D'abord, créez un répertoire pour les clés, puis générez les clés.

ATTENTION : La section suivante comprend également les résultats du système.


Translations Ignore


Code Block
titleGénérer des clés
mkdir /etc/ssl/newkey openssl genrsa -out /etc/ssl/newkey/cert.key 3072 openssl req -new -x509 -key /etc/ssl/newkey/cert.key -sha256 -out /etc/ssl/newkey/cert.pem -days 730   # # Answer the questions as follows (for example): # 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) [XX]:DE State or Province Name (full name) []:Bavaria Locality Name (eg, city) [Default City]:Munich Organization Name (eg, company) [Default Company Ltd]:jtel GmbH Organizational Unit Name (eg, section) []:IT Common Name (eg, your name or your server's hostname) []:acd-lb.domain.de Email Address []:lewis.graham@jtel.de



Vérifier le certificat généré

Vérifiez si les noms alternatifs ont été saisis :

Translations Ignore


Code Block
titleVérifiez
openssl x509 -in /etc/ssl/newkey/cert.pem -text -noout # Check if all DNS names are listed with this entry: # X509v3 Subject Alternative Name:



Créer et copier .pem combinés

Translations Ignore


Code Block
titlePEM combinés
cat /etc/ssl/newkey/cert.key > /etc/ssl/newkey/comb.pem cat /etc/ssl/newkey/cert.pem >> /etc/ssl/newkey/comb.pem cp /etc/ssl/newkey/comb.pem /etc/haproxy/haproxy.pem chmod 400 /etc/haproxy/haproxy.pem



entrez le certificat dans haproxy.cfg et ajustez la configuration du frontal pour rediriger

Translations Ignore


Code Block
titlePEM combinés
# # Frontend http redirects to https # frontend acdportal_http mode http bind :80 redirect scheme https if !{ ssl_fc } # # Frontend for https with certificate # frontend acdportal_https mode http bind :443 ssl crt /etc/haproxy/haproxy.pem #verify optional ...