Importer un certificat serveur

Vous pouvez télécharger un certificat serveur dans Elastic Identity Management (EIM) que vous pouvez ensuite utiliser avec un listener de load balancer pour permettre la terminaison SSL.

Ce certificat doit être au format x509. Vous devez fournir :

  • Le certificat

  • La chaine d’autorités de certification intermédiaires si votre certificat n’est pas signé par une autorité de certification source

  • La clé privée correspondant, qui ne doit pas être protégée par un mot de passe

L’ensemble de ces éléments doivent être au format PEM.

Importer un certificat serveur avec OSC CLI

À ce jour, cette section est disponible en anglais uniquement.

The CreateServerCertificate command creates a server certificate and its matching private key.

These elements can be used with other services (for example, to configure SSL termination on load balancers).

You can also specify the chain of intermediate certification authorities if your certificate is not directly signed by a root one. You can specify multiple intermediate certification authorities in the CertificateChain parameter. To do so, concatenate all certificates in the correct order (the first certificate must be the authority of your certificate, the second must be the authority of the first one, and so on).

The private key must be a RSA key in PKCS1 form. To check this, open the PEM file and ensure its header reads as follows: BEGIN RSA PRIVATE KEY.

This private key must not be protected by a password or a passphrase.

For more information, see About Server Certificates in EIM.

Request sample
$ osc-cli api CreateServerCertificate --profile "default" \
    --Name "server-cert-example" \
    --Body="$(cat certificate.pem)" \
    --Chain="$(cat certificate-chain.pem)" \
    --PrivateKey="$(cat private-key.pem)" \
    --Path "/example/"

This command contains the following attributes that you need to specify:

  • Body: The PEM-encoded X509 certificate.
    With OSC CLI, use the following syntax to make sure your certificate file is correctly parsed: --Body="$(cat FILENAME)".

  • Chain: (optional) The PEM-encoded intermediate certification authorities.
    With OSC CLI, use the following syntax to make sure your certificate chain file is correctly parsed: --Chain="$(cat FILENAME)".

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Name: A unique name for the certificate. Constraints: 1-128 alphanumeric characters, pluses (+), equals (=), commas (,), periods (.), at signs (@), minuses (-), or underscores (_).

  • Path: (optional) The path to the server certificate, set to a slash (/) if not specified.

  • PrivateKey: The PEM-encoded private key matching the certificate.
    With OSC CLI, use the following syntax to make sure your key file is correctly parsed: --PrivateKey="$(cat FILENAME)".

The CreateServerCertificate command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

  • ServerCertificate: Information about the server certificate.

    • ExpirationDate: The date on which the server certificate expires.

    • Id: The ID of the server certificate.

    • Name: The name of the server certificate.

    • Orn: The OUTSCALE Resource Name (ORN) of the server certificate. For more information, see Resource Identifiers > OUTSCALE Resource Names (ORNs).

    • Path: The path to the server certificate.

    • UploadDate: The date on which the server certificate has been uploaded.

Result sample
{
  "ServerCertificate": {
    "Path": "/example/",
    "Id": "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234",
    "Orn": "orn:ows:idauth::012345678910:server-certificate/example/server-cert-example",
    "Name": "server-cert-example"
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Importer un certificat serveur avec oapi-cli

À ce jour, cette section est disponible en anglais uniquement.

The CreateServerCertificate command creates a server certificate and its matching private key.

These elements can be used with other services (for example, to configure SSL termination on load balancers).

You can also specify the chain of intermediate certification authorities if your certificate is not directly signed by a root one. You can specify multiple intermediate certification authorities in the CertificateChain parameter. To do so, concatenate all certificates in the correct order (the first certificate must be the authority of your certificate, the second must be the authority of the first one, and so on).

The private key must be a RSA key in PKCS1 form. To check this, open the PEM file and ensure its header reads as follows: BEGIN RSA PRIVATE KEY.

This private key must not be protected by a password or a passphrase.

For more information, see About Server Certificates in EIM.

Request sample
$ oapi-cli --profile "default" CreateServerCertificate \
    --Name "server-cert-example" \
    --Body --file "certificate.pem" \
    --Chain --file "certificate-chain.pem" \
    --PrivateKey --file "private-key.pem" \
    --Path "/example/"

This command contains the following attributes that you need to specify:

  • Body: The PEM-encoded X509 certificate.
    With OSC CLI, use the following syntax to make sure your certificate file is correctly parsed: --Body="$(cat FILENAME)".

  • Chain: (optional) The PEM-encoded intermediate certification authorities.
    With OSC CLI, use the following syntax to make sure your certificate chain file is correctly parsed: --Chain="$(cat FILENAME)".

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Name: A unique name for the certificate. Constraints: 1-128 alphanumeric characters, pluses (+), equals (=), commas (,), periods (.), at signs (@), minuses (-), or underscores (_).

  • Path: (optional) The path to the server certificate, set to a slash (/) if not specified.

  • PrivateKey: The PEM-encoded private key matching the certificate.
    With OSC CLI, use the following syntax to make sure your key file is correctly parsed: --PrivateKey="$(cat FILENAME)".

The CreateServerCertificate command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

  • ServerCertificate: Information about the server certificate.

    • ExpirationDate: The date on which the server certificate expires.

    • Id: The ID of the server certificate.

    • Name: The name of the server certificate.

    • Orn: The OUTSCALE Resource Name (ORN) of the server certificate. For more information, see Resource Identifiers > OUTSCALE Resource Names (ORNs).

    • Path: The path to the server certificate.

    • UploadDate: The date on which the server certificate has been uploaded.

Result sample
{
  "ServerCertificate": {
    "Path": "/example/",
    "Id": "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234",
    "Orn": "orn:ows:idauth::012345678910:server-certificate/example/server-cert-example",
    "Name": "server-cert-example"
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Importer un certificat serveur avec AWS CLI

Avant de commencer : Installez et configurez AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

Pour télécharger un certificat serveur dans EIM, utilisez la commande upload-server-certificate en suivant cette syntaxe :

Exemple de requête
$ aws iam upload-server-certificate \
    --profile YOUR_PROFILE \
    --certificate-body file://certificate.pem \
    --certificate-chain file://certificate_chain.pem \
    --path /division/subdivision \
    --private-key file://private_key.pem \
    --server-certificate-name my-server-certificate \
    --endpoint https://eim.eu-west-2.outscale.com

Cette commande contient les attributs suivants que vous devez spécifier :

  • (optionnel) profile : Le profil nommé que vous voulez utiliser, créé pendant la configuration d’AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

  • certificate-body : Le certificat x509 au format PEM.

  • (optionnel) certificate-chain : La chaine d’autorités de certifications intermédiaires au format PEM.

  • (optionnel) path : Le chemin du certificat serveur, paramétré sur un slash (/) si non spécifié.

  • private-key : La clé privée correspondant au certificat au format PEM.

  • server-certificate-name : Le nom pour le certificat, qui doit être unique.

  • endpoint : Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête. Pour en savoir plus, voir Installer et configurer AWS CLI.

La commande upload-server-certificate renvoie les éléments suivants :

  • ServerCertificateMetadata : Les metadata du certificat serveur téléchargé. Cet élément contient les informations suivantes :

    • Arn : L’OUTSCALE Resource Name (ORN) du certificat serveur.

    • Path : Le chemin du certificat serveur.

    • ServerCertificateId : L’ID du certificat serveur, généré par EIM.

    • ServerCertificateName : Le nom du certificat serveur.

Exemple de résultat
{
    "ServiceCertificateMetadata":
                               {
                                "Arn": "my_load_balancer_1234567890.lbu.eu-west-2.outscale.com",
                                "Path": "/division/subdivision",
                                "ServerCertificateId": "ABCDEFGHIJK1L2MNOPQRS",
                                "ServerCertificateName": "my-server-certificate",
                               }
}

Le certificat serveur est téléchargé.

Pages connexes

Méthode API correspondante

AWS™ et Amazon Web Services™ sont des marques de commerce d’Amazon Technologies, Inc. ou de ses affiliées aux États-Unis et/ou dans les autres pays.