Skip to main content

Configuring TLS

You can configure Transport Layer Security (TLS) on votre instance GitHub Enterprise Server so that you can use a certificate that is signed by a trusted certificate authority.

About Transport Layer Security

TLS, which replaced SSL, is enabled and configured with a self-signed certificate when GitHub Enterprise Server is started for the first time. As self-signed certificates are not trusted by web browsers and Git clients, these clients will report certificate warnings until you disable TLS or upload a certificate signed by a trusted authority, such as Let's Encrypt.

The GitHub Enterprise Server appliance will send HTTP Strict Transport Security headers when SSL is enabled. Disabling TLS will cause users to lose access to the appliance, because their browsers will not allow a protocol downgrade to HTTP. For more information, see "HTTP Strict Transport Security (HSTS)" on Wikipedia.

Avertissement : Quand des connexions HTTPS se terminent sur un équilibreur de charge, les demandes de l’équilibreur de charge vers GitHub Enterprise Server doivent également utiliser HTTPS. Le passage de la connexion HTTPS à HTTP n’est pas pris en charge.

To allow users to use FIDO U2F for two-factor authentication, you must enable TLS for your instance. For more information, see "Configuration de l’authentification à 2 facteurs."

Prerequisites

To use TLS in production, you must have a certificate in an unencrypted PEM format signed by a trusted certificate authority. To use a certificate signed by an internal certificate authority, you must install the root certificate and any intermediate certificates. For more information, see "Troubleshooting TLS errors."

Your certificate will also need Subject Alternative Names configured for the subdomains listed in "Enabling subdomain isolation" and will need to include the full certificate chain if it has been signed by an intermediate certificate authority. For more information, see "Subject Alternative Name" on Wikipedia.

You can generate a certificate signing request (CSR) for your instance using the ghe-ssl-generate-csr command. For more information, see "Utilitaires de ligne de commande."

Your key must be an RSA key and must not have a passphrase. For more information, see "Troubleshooting TLS errors".

Uploading a custom TLS certificate

Avertissement : la configuration de TLS entraîne un petit temps d’arrêt pour votre instance GitHub Enterprise Server.

  1. À partir d’un compte d’administration sur GitHub Enterprise Server, cliquez sur en haut à droite de n’importe quelle page.

  2. Si vous ne figurez pas déjà sur la page « Administrateur du site », dans le coin supérieur gauche, cliquez sur Administrateur du site.

  3. Dans la barre latérale «  Administrateur de site », cliquez sur Management Console .

  4. Dans la barre latérale « Paramètres », cliquez sur Confidentialité.

  5. Sélectionnez TLS uniquement (recommandé) .

  6. Under "TLS Protocol support", select the protocols you want to allow.

  7. Under "Certificate", click Choose File, then choose a TLS certificate or certificate chain (in PEM format) to install. This file will usually have a .pem, .crt, or .cer extension.

  8. Under "Unencrypted key", click Choose File, then choose an RSA key (in PEM format) to install. This file will usually have a .key extension.

  9. Sous la barre latérale « Paramètres », cliquez sur Enregistrer les paramètres.

    Remarque : l’enregistrement des paramètres dans la Management Console redémarre les services système, ce qui peut entraîner un temps d’arrêt visible pour l’utilisateur.

  10. Attendez la fin de l’exécution de la configuration.

About Let's Encrypt support

Let's Encrypt is a public certificate authority that issues free, automated TLS certificates that are trusted by browsers using the ACME protocol. You can automatically obtain and renew Let's Encrypt certificates on your appliance without any required manual maintenance.

Pour utiliser l’automatisation Let’s Encrypt, votre appliance doit être configurée avec un nom d’hôte accessible publiquement sur HTTP. L’appliance doit également être autorisée à établir des connexions HTTPS sortantes.

When you enable automation of TLS certificate management using Let's Encrypt, votre instance GitHub Enterprise Server will contact the Let's Encrypt servers to obtain a certificate. To renew a certificate, Let's Encrypt servers must validate control of the configured domain name with inbound HTTP requests.

You can also use the ghe-ssl-acme command line utility on votre instance GitHub Enterprise Server to automatically generate a Let's Encrypt certificate. For more information, see "Utilitaires de ligne de commande."

Configuring TLS using Let's Encrypt

Pour utiliser l’automatisation Let’s Encrypt, votre appliance doit être configurée avec un nom d’hôte accessible publiquement sur HTTP. L’appliance doit également être autorisée à établir des connexions HTTPS sortantes.

Avertissement : la configuration de TLS entraîne un petit temps d’arrêt pour votre instance GitHub Enterprise Server.

  1. À partir d’un compte d’administration sur GitHub Enterprise Server, cliquez sur en haut à droite de n’importe quelle page.

  2. Si vous ne figurez pas déjà sur la page « Administrateur du site », dans le coin supérieur gauche, cliquez sur Administrateur du site.

  3. Dans la barre latérale «  Administrateur de site », cliquez sur Management Console .

  4. Dans la barre latérale « Paramètres », cliquez sur Confidentialité.

  5. Sélectionnez TLS uniquement (recommandé) .

  6. Select Enable automation of TLS certificate management using Let's Encrypt.

  7. Sous la barre latérale « Paramètres », cliquez sur Enregistrer les paramètres.

    Remarque : l’enregistrement des paramètres dans la Management Console redémarre les services système, ce qui peut entraîner un temps d’arrêt visible pour l’utilisateur.

  8. Attendez la fin de l’exécution de la configuration.

  9. Dans la barre latérale « Paramètres », cliquez sur Confidentialité.

  10. Click Request TLS certificate.

  11. Wait for the "Status" to change from "STARTED" to "DONE".

    Screenshot of the "Requesting TLS Certificate" dialog. At the top of the dialog, "STATUS: DONE" is highlighted with an orange outline.

  12. Click Save configuration.

Troubleshooting TLS with Let's Encrypt

You can troubleshoot issues that affect your TLS certificate from Let's Encrypt.

Error: "Security error prevented the resource from being loaded"

In some cases, end users may report that pages for services on votre instance GitHub Enterprise Server respond with the following error in a browser's developer tools.

Security error prevented the resource from being loaded

To resolve these errors, you must update the Subject Alternative Names (SANs) your Let's Encrypt certificate by reissuing the certificate. Replacement of an instance's certificate requires user-facing downtime.

  1. Communicate the upcoming downtime to your users, and consider enabling maintenance mode. For more information, see the following articles.

  2. Connexion SSH à votre instance GitHub Enterprise Server. Si votre instance comprend plusieurs nœuds, par exemple si la haute disponibilité ou la géoréplication sont configurées, connectez-vous via SSH au nœud principal. Si vous utilisez un cluster, vous pouvez vous connecter via SSH à n’importe quel nœud. Remplacez HOSTNAME par le nom d’hôte de votre instance, le nom d’hôte ou l’adresse IP d’un nœud. Pour plus d’informations, consultez « Accès à l’interpréteur de commandes d’administration (SSH) ».

    Shell
    ssh -p 122 admin@HOSTNAME
    
  3. To disable Let's Encrypt, run the following command.

    Shell
    ghe-ssl-acme -d
    
  4. To clear the existing settings for Let's Encrypt, run the following command.

    Shell
    ghe-ssl-acme -x
    
  5. To request and install a new certificate from Let's Encrypt, run the following command.

    Shell
    ghe-ssl-acme -e
    
  6. Pour appliquer la configuration, exécutez la commande suivante.

    Remarque : Durant une exécution de configuration, les services sur votre instance GitHub Enterprise Server peuvent redémarrer, ce qui peut entraîner un bref temps d’arrêt pour les utilisateurs.

    Shell
    ghe-config-apply
    
  7. Attendez la fin de l’exécution de la configuration.

  8. If you configured a user message or maintenance mode, remove the message and disable maintenance mode.